Skip to content

Instantly share code, notes, and snippets.

View universal's full-sized avatar

Johannes / universa1 universal

View GitHub Profile
public class MyClass
{
public static void main(String args[])
{
System.out.println("Hello World".hashCode());
}
}
=> -862545276
#!/bin/bash
# Favicon and Apple Touch Icon Generator
#
# This bash script takes an image as a parameter, and uses ImageMagick to convert it to several
# other formats used on modern websites. The following copies are generated:
#
# * apple-touch-icon-114x114-precomposed.png
# * apple-touch-icon-57x57-precomposed.png
# * apple-touch-icon-72x72-precomposed.png
@universal
universal / destroy.js.erb
Created October 19, 2012 10:10 — forked from anonymous/gist:3917294
ajax delete issue
$('#<%= dom_id(@match) %>').fadeOut();
describe "GET #new" do
before do
@user = User.new
User.stub(:new).and_return(@user)
end
it "authorizes access" do
should_authorize(:new, @user)
get :new
ned
@universal
universal / 1 - checkout_helper.rb
Created March 20, 2012 10:18
Improve Spree's checkout step indicator
# At this checkout step indicator, all the checkout steps are turned into links. But how to
# turn *only* my completed steps into links?
#
# <jammanbo> state_machine has no memory. if you need to determine whether you have been
# in a state you need to design your machine so that that can be determined from the
# current state.
#
# ----------
#
# Expected result: