Skip to content

Instantly share code, notes, and snippets.

View jcf's full-sized avatar
❤️

James Conroy-Finn jcf

❤️
View GitHub Profile
@jcf
jcf / fix.sh
Last active December 20, 2015 01:28
Failed installation of puma 2.3.2 (Mavericks 10.9)
# Cleanup old GCC if it's installed
brew uninstall apple-gcc42
# Maybe unnecessary…
sudo xcode-select --reset
# Use developer preview of Xcode
sudo xcode-select --switch /Applications/Xcode5-DP3.app
# Wipe out existing Xcode
<html>
<!-- machid: wSkVzVGpTMGVtWHlhamFtbTl0RlJMTXpfRlk1NWRnLWxTQmFUbTlkcHNsS2JCSXVCUlkydHhn -->
<head><title>500 Internal Server Error</title></head>
<body>
<h1>500 Internal Server Error</h1>
<p>Sorry, something went wrong.<br><br>A team of highly trained monkeys has been dispatched to deal with this situation.</p>
If you see them, show them this information:<br>
<pre>z4C7gLSdHPg_Nc310LY_nybJoBHMyWh1yiNlAyv6KTBCOsQ_z4y_L73LP7OO
oSQh_zvXYNwSaChx2ZBTeqBLxzyuPf8KQeGt-oEaFHSCzVImg5wnZNhCosd2
@jcf
jcf / caching.rb
Created May 16, 2013 14:05
Rails.cache metaprogramming
module Caching
def cache(name)
wrapper = "#{name}_without_caching"
alias_method(wrapper, name)
remove_method(name)
class_eval <<-RUBY, __FILE__, __LINE__ + 1
def #{name}
Rails.cache.fetch(self, method_name: "#{self}##{name}") do
#{wrapper}
end
@jcf
jcf / gist:5511507
Created May 3, 2013 17:16
/etc/sudoers
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors
# that prevent sudo from running.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
@jcf
jcf / gist:5510551
Created May 3, 2013 16:15
sysctl.conf
kern.sysv.shmall=65536
kern.sysv.shmmax=16777216
@jcf
jcf / index.html
Created April 20, 2013 12:32
retina.local:/Library/WebServer/Documents
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>retina.local</title>
<link href="http://www.gravatar.com/avatar/18c2795810ee15d41956e7f4cc5f3338?size=32" rel="icon">
<link href="/style.css" media="all" rel="stylesheet">
<script type="text/javascript" src="//use.typekit.net/vsh5kje.js"></script>
@jcf
jcf / Gemfile.lock
Last active December 16, 2015 07:09
Rails 4, puma, NewRelic
GIT
remote: git://github.com/drapergem/draper.git
revision: e20604ac02023c37609011174adedddf493fe6eb
specs:
draper (1.2.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
request_store (~> 1.0.3)
GIT
@jcf
jcf / avatars.pl
Last active December 14, 2015 14:09
Gource visualisation
#!/usr/bin/perl
#fetch Gravatars
# From http://code.google.com/p/gource/wiki/GravatarExample
use strict;
use warnings;
use LWP::Simple;
use Digest::MD5 qw(md5_hex);
@jcf
jcf / spoonfeed.rb
Created January 29, 2013 21:33
Spoonfed cluster
Ironfan.cluster 'spoonfeed' do
cloud(:ec2) do
permanent false
availability_zones ['eu-west-1a']
flavor 'm1.medium'
backing 'ebs'
image_name 'natty'
bootstrap_distro 'ubuntu10.04-ironfan'
chef_client_script 'client.rb'
mount_ephemerals
@jcf
jcf / ironfan-error-log
Created January 29, 2013 18:21
ERROR: undefined method `group_id' for nil:NilClass (NoMethodError)
WARNING: undefined method `group_id' for nil:NilClass
ERROR: undefined method `group_id' for nil:NilClass (NoMethodError)
/Users/jcf/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/ironfan-4.7.6/lib/ironfan/provider/ec2/machine.rb:243:in `block in launch_description'
/Users/jcf/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/ironfan-4.7.6/lib/ironfan/provider/ec2/machine.rb:242:in `map'
/Users/jcf/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/ironfan-4.7.6/lib/ironfan/provider/ec2/machine.rb:242:in `launch_description'
/Users/jcf/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/ironfan-4.7.6/lib/ironfan/provider/ec2/machine.rb:155:in `create!'
/Users/jcf/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/ironfan-4.7.6/lib/ironfan/broker/computer.rb:77:in `launch'
/Users/jcf/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/ironfan-4.7.6/lib/ironfan/broker/computer.rb:324:in `block in launch'
/Users/jcf/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/i