Skip to content

Instantly share code, notes, and snippets.

View xoebus's full-sized avatar
🤖
beep beep

Christopher Brown xoebus

🤖
beep beep
  • San Francisco, CA
View GitHub Profile
@steveklabnik
steveklabnik / fetch_gists.rb
Last active December 15, 2015 15:29
Fetch Gists from the API
require 'net/http'
require 'json'
# a simple wrapper to do an HTTP GET
def fetch_uri(uri)
Net::HTTP.get_response(URI(uri))
end
# GETs the URI and returns a Ruby hash.
def fetch_json(uri)
@amokan
amokan / gist:3881064
Created October 12, 2012 19:36
jenkins-cli commands (v1.485)
build
Builds a job, and optionally waits until its completion.
cancel-quiet-down
Cancel the effect of the "quiet-down" command.
clear-queue
Clears the build queue
connect-node
Reconnect to a node
copy-job
Copies a job.
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@seadowg
seadowg / frappuccino.coffee
Created August 13, 2012 01:13
Prototype FRP + Backbone collision
class Frappuccino.Backbone.Event extends Backbone.Event
event: (event_name) -> new Frappuccino.Event(this, event_name)
class Frappuccino.Event extends Backbone.Event
constructor: (origin, event) ->
@origin = origin
@event = event
@origin.bind(@event, (value) => this.occur(value))
@jimweirich
jimweirich / analysis.rb
Created July 20, 2011 16:37
Results from Roman Numeral Calculator Kata at @cincinnatirb
# When I posted the results of the Roman Numeral Calculator kata
# earlier this week, I said that I felt that the evolution of the code
# through TDD was much more interesting than the final result. Let me
# explain.
#
# First, some background. The goal of this Kata is to produce a
# RomanNumeralCalculator object that converts from arabic numbers to
# Roman numerals, and from Roman numerals back to arabic.
Then { calculate("1").should == "I" }
@protocool
protocool / caveatPatchor.js
Created February 14, 2011 02:29
Sample caveatPatchor.js file for use in Propane 1.1.2 and above
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@dahlia
dahlia / lisp.rb
Created September 2, 2010 07:52
30 minutes Lisp in Ruby
# 30 minutes Lisp in Ruby
# Hong Minhee <http://dahlia.kr/>
#
# This Lisp implementation does not provide a s-expression reader.
# Instead, it uses Ruby syntax like following code:
#
# [:def, :factorial,
# [:lambda, [:n],
# [:if, [:"=", :n, 1],
# 1,
@collegeman
collegeman / fresh-install.mkd
Created April 29, 2010 19:57 — forked from kennethreitz/fresh-install.mkd
Fresh installation hit list for Mac OSX developers
@xoebus
xoebus / Rakefile
Created April 23, 2010 15:00
Rakefile for managing lots of git repositories in one directory.
require "pathname"
GIT_REPOS = Dir["**/.git/.."].map { |path| path = Pathname.new(path).realpath }
desc "Update all repositories"
task :update do
GIT_REPOS.each do |repo|
command "git pull origin master", repo
end
end
@xoebus
xoebus / colours.rb
Created April 4, 2010 22:34
ANSI Colours for Ruby
class String
[:gray, :red, :green, :yellow, :blue, :purple, :cyan, :white].each_with_index do |color, i|
define_method color do "\033[1;#{30+i}m#{self}\033[0m" end
define_method :"#{color}ish" do "\033[0;#{30+i}m#{self}\033[0m" end
end
end