Skip to content

Instantly share code, notes, and snippets.

View jkarttunen's full-sized avatar

Juha Karttunen jkarttunen

View GitHub Profile
@heikki
heikki / gist:4030954
Last active November 19, 2015 12:29
Notes for VirtualBox IE setup
https://www.virtualbox.org/wiki/Downloads
https://github.com/xdissent/ievms
For each installed VM:
- Enable copy&paste (Settings -> General -> Advanced -> Shared Clipboard -> Host To Guest)
- Add more video memory (Settings -> Display -> Video -> Video Memory -> 128 MB ?)
- Add Finnish keyboard layout as default and remove others
- Set IE homepage to about:blank
- Disable Windows key http://support.microsoft.com/kb/216893#FixItForMeAlways
- Take snapshot
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@melborne
melborne / haskell_sequence.rb
Created July 7, 2011 14:02
Haskell-like Arithmetic Sequence in Ruby
# encoding: UTF-8
class Array
alias __eq__ ===
def ===(other)
if self.size == other.size and any? { |item| item.instance_of? Class }
other = other.to_enum
return all? { |item| item === other.next }
end
__eq__(other)
end