Skip to content

Instantly share code, notes, and snippets.

Avatar
At harbour

John Barton joho

At harbour
View GitHub Profile
View Makefile
# A simple Makefile alternative to using Grunt for your static asset compilation
#
## Usage
#
# $ npm install
#
# And then you can run various commands:
#
# $ make # compile files that need compiling
# $ make clean all # remove target files and recompile from scratch
@joho
joho / gist:3735740
Created Sep 17, 2012 — forked from rafaelss/gist:3700977
PostgreSQL 9.2 upgrade steps
View gist:3735740
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. brew update
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. cp /usr/local/Cellar/postgresql/9.2.0/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
@joho
joho / dabblet.css
Created May 18, 2012 — forked from anonymous/dabblet.css
Goodfilms New Header
View dabblet.css
/**
* Goodfilms New Header
*/
/* Rectangle 4: */
.box {
background: #FFA700;
width: 960px;
height: 100px;
@joho
joho / application.html.erb
Created Sep 5, 2011 — forked from mtcmorris/gist:1194204
Mustaches for everyone!!
View application.html.erb
<% if moustaches? %>
<script type="text/javascript">
$(document).ready(function() {
$(".thumbnail img").each(function() {
$(this).attr("src", "http://mustachify.me/?src=" + $(this).attr("src"));
});
});
</script>
<% end %>
View JB - Top 10, 2010
1. Arcade Fire - The Suburbs
2. The Black Keys - Brothers
3. Frightened Rabbit - The Winter of Mixed Drinks
4. Jonsi - Go
5. Trent Reznor and Atticus Ross - The Social Network
6. Midlake - The Courage of Others
7. The Roots - How I Got Over
8. The National - High Violet
9. Kanye West - My Beautiful Dark Twisted Fantasy
10. Sia - We Are Born
View unicode-methods.rb
def ¿
puts 'IMA UPSIDEDOWN QUESTIONMARK LOL'
end
¿ # => IMA UPSIDEDOWN QUESTIONMARK LOL
¿ # => IMA UPSIDEDOWN QUESTIONMARK LOL
¿ # => IMA UPSIDEDOWN QUESTIONMARK LOL
¿ # => IMA UPSIDEDOWN QUESTIONMARK LOL
¿ # => IMA UPSIDEDOWN QUESTIONMARK LOL
¿ # => IMA UPSIDEDOWN QUESTIONMARK LOL
View try.rb
try_do_thingo!
if thingo_worked_out?
sweet!
else
whatever!
end
def meh
View reject-nils.rb
class Array
def fuck_off_you_fucking_nil_cunts!
compact
end
end
View SignupController.rb
class SignupController < ActionController::Base
def step_two
@signup = Signup.find(params[:id])
@signup.advance_step do |signup|
signup.attributes = params[:signup]
signup.save!
end
end
end
View gist:117894
irb(main):005:0> n = "James"
=> "James"
irb(main):006:0> n.strip!
=> nil
irb(main):007:0> n
=> "James"
# that's just plain weird
>> n = "john "
=> "john "