Created by: Jack Kinsella

vim - select the insides of the quotation marks from anywhere on the line

things(args, "something") {
}

vi"

Created by: Jack Kinsella

how to get the remote ip of a request

request.remote_ip

Created by: Jack Kinsella

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

Created by: Jack Kinsella

Jump to tag under cursor

<C-]>

Created by: Jack Kinsella

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

Created by: Jack Kinsella

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

Created by: Jack Kinsella

How do you get the name of the class of an object

.class

Created by: Jack Kinsella

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

Created by: Jack Kinsella

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}

Created by: Jack Kinsella

another way of thinking about when to raise an exception

when the input/system condition would be nonsense

Created by: Jack Kinsella

can you call "cat" to display the contents of a dir

NO - use ls instead

Created by: Jack Kinsella

how to quit postgres

\q

You must be logged in to perform this action.

Login now

×

Deck Management

You must be logged in to perform this action.

Login now

Done ×

Deck Management

You must be logged in to perform this action.

Login now

Done ×

Deck Management

You must be logged in to perform this action.

Login now

Done ×

Deck Management

You must be logged in to perform this action.

Login now

Done ×

Deck Management

You must be logged in to perform this action.

Login now

Done ×

Deck Management

You must be logged in to perform this action.

Login now

Done ×

Deck Management

You must be logged in to perform this action.

Login now

Done ×

Deck Management

You must be logged in to perform this action.

Login now

Done ×

Deck Management

You must be logged in to perform this action.

Login now

Done ×

Deck Management

You must be logged in to perform this action.

Login now

Done ×

Deck Management

You must be logged in to perform this action.

Login now

Done ×

Deck Management

You must be logged in to perform this action.

Login now

Done ×