Skip to content

Instantly share code, notes, and snippets.

@jraines
jraines / rails31init.md
Created May 24, 2011 17:03
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@kjoconnor
kjoconnor / gist:1007303
Created June 3, 2011 22:37
Logstash Agent init script
#! /bin/sh
#
# Logstash Start/Stop logstash
#
# chkconfig: 345 99 99
# description: Logstash
# processname: logstash
logstash_bin="java -Djava.net.preferIPv4Stack=true -jar /opt/logstash/logstash-1.0.11pre-monolithic.jar"
logstash_log="/opt/logstash/logstash-agent.log"
@timsavery
timsavery / Ruby Download Parse JSON
Created January 22, 2012 15:19
Example For Downloading and Parsing JSON (Ruby)
require "rubygems"
require "json"
require "net/http"
require "uri"
uri = URI.parse("http://api.sejmometr.pl/posiedzenia/BZfWZ/projekty")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)
@mathieue
mathieue / init-bucky
Created May 28, 2012 13:46
Monit conf for bucky (statsd daemon)
#!/bin/bash
case $1 in
start)
echo $$ > /var/run/bucky.pid;
exec 2>&1 /usr/local/bin/bucky --disable-collectd --statsd-ip=192.168.0.1 /etc/bucky.py | logger -t bucky
;;
stop)
kill `cat /var/run/bucky.pid` ;;
*)
echo "usage: bucky {start|stop}" ;;
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active June 30, 2024 04:14
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@obfusk
obfusk / break.py
Last active May 1, 2024 20:32
python "breakpoint" (more or less equivalent to ruby's binding.pry); for a proper debugger, use https://docs.python.org/3/library/pdb.html
import code; code.interact(local=dict(globals(), **locals()))