Skip to content

Instantly share code, notes, and snippets.

require 'rack'
require 'action_dispatch'
class Controller
def self.action(name)
-> (env) do
new(env).send(name)
end
end
defmodule Chop do
def guess(actual, range) do
midpoint(range)
|> print_guess
|> do_guess(actual, range)
end
defp do_guess(guess, actual, _) when guess == actual do
IO.puts guess
end
function fish_prompt
set_color green
echo -n (pwd | sed "s!^$HOME!~!")
set_color cyan
if test -d .git
echo -n '' (git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1]/")
if [ (git status 2> /dev/null | tail -n1) != 'nothing to commit, working directory clean' ]
module SimplestAuth
module Model
def self.included(base)
adapters.each do |adapter|
if adapter.registered?(base)
include adapter
end
end
end
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtrRGakN2WRoXUIHhIVTg2d87EselCvRfI/Not+eE3gAQRm9m1v7hWGM6gDUTNnUGmda5+rHZgbxvrLwLTxNj3HmJNwQ63iiij6FdWk3f7mK8mBqnz7oPjwEF8HO/R1eJPenSe/C4KLyRVUHmmfbDDsJ6EALoy6+t4/VJFbi3NjnxftfxWIoiFw9R4FkmsDamuPue3wzA+qexhWhEEXDzOlLy6O+Nt47lfnWSRZPOKLc+kMljfq1NA2+ct+hnqVurSqpm332M27QdLucPmG/Jzo1EO/Pyp3it9KJAJ/qn9QcfiODL2rUnk9ZQTnm9ctEhdrTPeCyqBIJ+idYMt3LsKw== Chris@Callisto.local
@yaychris
yaychris / git-completion.sh
Created September 18, 2012 17:14
Git Completion
#!bash
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
@yaychris
yaychris / tlc.lua
Created March 28, 2012 16:39 — forked from fjolnir/tlc.lua
LuaJIT ObjC bridge
-- TLC - The Tiny Lua Cocoa bridge
-- Note: Only tested with LuaJit 2 Beta 9 on x86_64 with OS X >=10.7.3 & iPhone 4 with iOS 5
-- Copyright (c) 2012, Fjölnir Ásgeirsson
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
@yaychris
yaychris / id_rsa.pub
Created February 23, 2012 22:36
Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtrRGakN2WRoXUIHhIVTg2d87EselCvRfI/Not+eE3gAQRm9m1v7hWGM6gDUTNnUGmda5+rHZgbxvrLwLTxNj3HmJNwQ63iiij6FdWk3f7mK8mBqnz7oPjwEF8HO/R1eJPenSe/C4KLyRVUHmmfbDDsJ6EALoy6+t4/VJFbi3NjnxftfxWIoiFw9R4FkmsDamuPue3wzA+qexhWhEEXDzOlLy6O+Nt47lfnWSRZPOKLc+kMljfq1NA2+ct+hnqVurSqpm332M27QdLucPmG/Jzo1EO/Pyp3it9KJAJ/qn9QcfiODL2rUnk9ZQTnm9ctEhdrTPeCyqBIJ+idYMt3LsKw== Chris@Callisto.local
@yaychris
yaychris / php-fastcgi
Created January 4, 2012 19:25
ubuntu php fastcgi init.d script
#! /bin/sh
### BEGIN INIT INFO
# Provides: php-fastcgi
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop php-cgi in external FASTCGI mode
# Description: Start and stop php-cgi in external FASTCGI mode
### END INIT INFO