Skip to content

Instantly share code, notes, and snippets.

Jonathan Cairns joonty

Block or report user

Report or block joonty

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View test_spec.rb
describe "an example spec" do
context "greeting" do
def greeting
it "should be 'hello'" do
expect(greeting).to eq "hello"
joonty / log.txt
Created Nov 15, 2015
OpenSong Tablet compile errors
View log.txt
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72211Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42211Library UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
joonty / Error.txt
Created Nov 13, 2015
Reading from stdin in rust
View Error.txt
src/ 8:42 error: cannot borrow immutable local variable `buffer` as mutable
src/ try!(stdin.read_to_string(&mut buffer));
<std macros>:1:1: 6:48 note: in expansion of try!
src/ 8:45 note: expansion site
error: aborting due to previous error
View app-constraints-api_constraint.rb
class ApiConstraint
attr_reader :version
def initialize(options)
@version = options.fetch(:version)
def matches?(request)
joonty / instruction.rb
Last active Aug 29, 2015
Refactor hell
View instruction.rb
class Instruction < ActiveRecord::Base
def self.new_over_period(from, to, range, user)
where = ""
if user.is_solicitor
where = " AND instructions.solicitor_id IN ('""')"
joonty / unicorn
Created May 30, 2014
Unicorn service script
View unicorn
# Provides: unicorn
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Manage unicorn server
# Description: Start, stop, restart unicorn server for a specific application.
joonty / .tmux.conf
Created May 15, 2014
My tmux config
View .tmux.conf
set -g history-limit 5000
set-window-option -g utf8 on # utf8 support
# Open man page in new window
bind / command-prompt "split-window 'exec man %%'"
bind y run-shell "tmux show-buffer | xclip -sel clip -i" \; display-message "Copied tmux buffer to system clipboard"
set -g update-environment -r
# quick view of processes
bind '~' split-window "exec htop"
joonty / feed.xml
Created Apr 7, 2014
My Jekyll feed XML for
View feed.xml
layout: none
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="" xmlns:content="" xmlns:dc="" xmlns:sy="">
<title>{{ | xml_escape }}</title>
<description>{% if site.description %}{{ site.description | xml_escape }}{% endif %}</description>
<link>{{ site.url }}</link>
joonty / capistrano.rb
Created Feb 5, 2014
Capistrano local asset compilation
View capistrano.rb
namespace :assets do
desc 'Run the precompile task locally and rsync with shared'
task :precompile, :roles => :web, :except => { :no_release => true } do
if ENV['FORCE_ASSETS'] || releases.length <= 1 || capture("cd #{latest_release} && #{source.local.log(source.next_revision(current_revision))} vendor/assets/ app/assets/ | wc -l").to_i > 0
system('bundle exec rake assets:precompile')
puts "syncing assets with shared directory..."
%x{rsync --recursive --times --rsh=ssh --compress --human-readable --progress public/assets #{user}@#{host}:#{shared_path}}
system('bundle exec rake assets:clean')
joonty / sort.php
Created Oct 17, 2013
PHP sorting algorithm
View sort.php
$input = file("php://stdin");
file_put_contents(end($argv), join($input));
You can’t perform that action at this time.