vim - select the insides of the quotation marks from anywhere on the line
things(args, "something") {
}
vi"
- View
- 3 likes
css - how to set one element to go on top of another vertically?
z-index: 10000
# the higher the z-index number the higher the item
- View
- 0 likes
git - how to remove files from your hard drive which are not currently tracked by git (e.g. you did a git reset --hard and there are files lying about which were supposed to be removed)
git clean -f
# you must use the -f option for it to actually delete the files
# before using always run a git clean -n to dry run and see a list of what the -f command would do
- View
- 0 likes
redis - what does this do?
hset soulmate-data:tasks 1 "{\"term\":\"Take out the trash\"}"
saves value (here a json object) into a soulmate-data:tasks at key 1
- View
- 0 likes
rails - where email is not "jack@gmail.com" or "steve@gmail.com"
where("email != ? AND email != ?", "jack@gmail.com", "steve@gmail.com")
#note the need to write out the email != expression again twice
- View
- 0 likes
how to write a dsl which shoots out a message if code in a block is true
dsl:
event "we're earning money" {recent_order > 1000 }
def event(name)
puts name if yield
end
Dir.glob('*events.rb').each {|file| load_file}
- View
- 1 like
another way of thinking about when to raise an exception
when the input/system condition would be nonsense
- View
- 0 likes