class String
def escape_single_quotes
self.gsub(/'/, "\\\\'")
end
end Usefull when passing strings to javascript. I placed mine in config/initializers
Notes for future ninya (if you're still a programmer)
class String
def escape_single_quotes
self.gsub(/'/, "\\\\'")
end
end Usefull when passing strings to javascript. I placed mine in config/initializers
git reset --hard HEAD~1 HEAD~1 is the commit before the HEAD branch. You could also use the SHA-1 hash of thecommit you want to revert to. Using --hard would remove all untracked files in your working directory so BACKUP! git revert HEAD If however you have pushed the wrong commit already. Use this. This one makes another commit from HEAD (or whatever commit you want to revert to). Then push it again.