Instantly share code, notes, and snippets.

View rudy-example.rb
# = Rudy -- Skeleton configuration
#
# Rudy automatically looks for configuration files in the following
# locations (in this order):
#
# ./.rudy/config
# ~/.rudy/config
#
# ./Rudyfile
# ./machines.rb, ./routines.rb, ./commands.rb
View cltools.sh
#!/bin/sh
##
# Install autoconf, automake and libtool smoothly on Mac OS X.
# Newer versions of these libraries are available and may work better on OS X
#
# This script is originally from http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html
#
export build=~/devtools # or wherever you'd like to build
View keybase.md

Keybase proof

I hereby claim:

  • I am delano on github.
  • I am delano (https://keybase.io/delano) on keybase.
  • I have a public key whose fingerprint is DAE4 DF31 4618 B56C 98C3 CBDF AE63 BC48 9CC3 BC2E

To claim this, I am signing this object:

View supervisord-example.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
View pedantically_commented_playbook.yml
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
View Distraction Free.sublime-settings
{
"line_numbers": true,
"gutter": true,
"draw_centered": false,
"wrap_width": 0,
"word_wrap": false,
"scroll_past_end": true
}
View gist:845643
# A DNS change to Rubygems.org is causing lingering issues. Namely,
# rubygems.org and production.s3.rubygems.org are still pointing to
# the old address. See:
# http://twitter.com/#!/gemcutter/status/30666857698557952
# The symptoms:
# $ gem install benelux --version 0.5.17
# ERROR: Could not find a valid gem 'benelux' (= 0.5.17) in any repository
# ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
View gist:837654
class TheBell
include HTTParty
#debug_output $stdout
base_uri 'http://api.thbll.com/ring-the-bell/SITENAME'
def self.ring
post("/PASSPHRASE/", :body => {})
end
end
#
View redis_pubsub_demo.rb
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# - a browser with WebSocket support
#
# Usage:
# ruby redis_pubsub_demo.rb
#
View gist:281000
# Power law (log tail) distribution
# Copyright(C) 2010 Salvatore Sanfilippo
# this code is under the public domain
# min and max are both inclusive
# n is the distribution power: the higher, the more biased
def powerlaw(min,max,n)
max += 1
pl = ((max**(n+1) - min**(n+1))*rand() + min**(n+1))**(1.0/(n+1))
max-1-pl.to_i