This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# jan's gitpush alias: http://railslove.com/weblog/2008/10/28/git-push-it-origin-master/#comments | |
alias gitpush=\ | |
'open http://www.youtube.com/watch?v=BCV5yGKWjv4; \ | |
git push origin master' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
#actually I just wanted to try forking a gist :D | |
exit unless ARGV.size == 1 | |
pids = %x[ps ax|grep #{ARGV[0]}|grep -v grep].split("\n").map{|line| line.strip.scan(/^\d+/).first.to_i} - [Process.pid] | |
if pids.any? | |
system "kill #{pids.join(' ')}" | |
puts "killed #{pids.size} #{ARGV[0]} instance(s)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fakebug = function() { | |
var firebug_methods = ["log", "info", "debug", "warn", "error", "assert", "dir", "dirxml", "trace", "group", "groupEnd", "time", "timeEnd", "profile", "profileEnd", "count"]; | |
window.console = {}; | |
for(var i=0;i<firebug_methods.length;i++) { | |
window.console[firebug_methods[i]] = function() {}; | |
} | |
}; | |
if(!window.console) { fakebug(); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ReTweeter = { | |
initialize: function() { | |
$(".status").each(function(count,status) { | |
var actions = $(status).find("td.actions div"); | |
var link = $("<a/>").attr({href:"/home/?status="+ReTweeter.reTweetOf(status)}); | |
link.append( $("<img/>").attr({src:"http://railslove.com/rt.gif", alt:"REtweet this"}) ) | |
link.bind("click",function(e){ | |
e.preventDefault(); | |
var status = $(this).parents(".status"); | |
$("#status").val(ReTweeter.reTweetOf(status)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RAILSLOVE.com template | |
# | |
# with help and ideas from: | |
# http://gist.github.com/33337 By Peter Cooper | |
# http://github.com/jeremymcanally/rails-templates/tree/master/suspenders.rb Suspenders by Thoughtbot Nathan Esquenazi | |
if yes?("symlink local rails copy to vendor?") | |
path = ask("what's the directory of your local rails copy?") | |
inside('vendor') { run "ln -s #{path} rails" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on handle_string(tweet) | |
tell application "Keychain Scripting" | |
set twitter_key to first Internet key of current keychain whose server is "twitter.com" | |
set twitter_login to quoted form of (account of twitter_key & ":" & password of twitter_key) | |
end tell | |
set twitter_status to quoted form of ("status=" & tweet) | |
set results to do shell script "curl --user " & twitter_login & " --data-binary " & twitter_status & " http://twitter.com/statuses/update.json" | |
-- display dialog results | |
return nothing | |
end handle_string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# legacy User class to import users from a vbulletion database | |
class LegacyUser < LegacyModel | |
# important! please change: | |
self.model = User # which is the new Rails model | |
self.table_name = "vbulletin_user" # the vbulletin table name | |
# attribue mapping: {:rails => :vbulletin} | |
self.attribute_mapping = {:legacy_id => :userid, :name => :username, :email => :email, :password => :email, :password_confirmation => :email} # map old vbulletin attrbute names to new rails attribute names {:rails => :vbulletin} | |
attr_accessor *self.attribute_mapping.values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// simple textarea resizing script for prototype | |
var ResizingTextArea = Class.create({ | |
min_height: 40, | |
rowHeight: 16, | |
padding: 4, | |
unit: "px", | |
initialize: function(field,options){ | |
Object.extend(this,(options||{})); | |
this.element = $(field); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Uploader = Class.create({ | |
fileList: null, | |
handler: null, | |
uploaded:0, | |
allowMultipleFiles: true, | |
simUploadLimit: 1, | |
parameterName: "file", | |
filter: { | |
images:{description:"Images", extensions:"*.jpg;*.JPG;*.png;*.PNG"}, | |
office:{description:"Office Document", extensions:"*.doc;*.DOC;*.docx;*.DOCX;*.xls;*.XLS;*.xlsx;*.XLSX;*.ppt;*.PPT;*.pptx;*.PPTX"} |
OlderNewer