Skip to content

Instantly share code, notes, and snippets.

@ryanb
ryanb / chef_solo_bootstrap.sh
Created April 5, 2012 04:35
Bootstrap Chef Solo
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
make
make install
@bicherele
bicherele / jquery.myplugin.coffee
Created March 14, 2012 14:20 — forked from jimeh/jquery.myplugin.coffee
Example jQuery plugin written in CoffeeScript, and the resulting compiled JavaScript file.
$.fn.extend
myplugin: (options) ->
self = $.fn.myplugin
opts = $.extend {}, self.default_options, options
$(this).each (i, el) ->
self.init el, opts
self.log el if opts.log
$.extend $.fn.myplugin,
default_options:
@bicherele
bicherele / gist:2029646
Created March 13, 2012 16:12 — forked from friggeri/gist:1570840
More CoffeeScriptish
do ($ = jQuery) ->
$.fn.zebraTable = (options) ->
defaults =
evenColor: '#ccc'
oddColor : '#eee'
options = $.extend(defaults, options)
@each ->
$("tr:even", @).css('background-color', options.evenColor)
$("tr:odd", @).css('background-color', options.oddColor)
@bicherele
bicherele / README.md
Created March 6, 2012 09:05 — forked from fnichol/README.md
Vagrantify: Create a chef-solo enabled Vagrant virtual machine for development

Installation

gem install thor
mkdir -p ~/vagrants && cd ~/vagrants
curl -LO https://raw.github.com/gist/1528832/vagrantify
chmod 755 vagrantify

Usage

./vagrantify init webserver

@tychobrailleur
tychobrailleur / .jrubyrc
Created March 4, 2012 14:32
Sample .jrubyrc, with comments
# Example of .jrubyrc
# Set compilation mode. JIT = at runtime; FORCE = before execution. (JIT, FORCE, OFF, OFFIR)
# compile.mode = FORCE
# Dump to console all bytecode generated at runtime.
# compile.dump = true
# Enable verbose JIT logging (reports failed compilation)
# jit.logging.verbose = true
@bicherele
bicherele / Rakefile
Created February 29, 2012 11:11 — forked from twistedmind/Rakefile
directory "tmp"
file "tmp/hello.tmp" => "tmp" do
sh "echo 'Hello' > 'tmp/hello.tmp'"
end
task :default => 'morning:turn_off_alarm'
namespace :morning do
desc "Turn off alarm."
@efeminella
efeminella / gist:1937609
Created February 29, 2012 04:13
Loading external Handlebars Templates with jQuery or Zepto
/*
* Extends Handlebars with a basic get method for loading external
* Handlebars templates. Simply pass an options object which contains
* the following properties:
* - path (required) : Path to the external template file to be loaded
* - success (required) : Callback invoked with the compiled loaded template.
* - cache (optional) : true if the template is to be cached, otherwise false.
*
* In addition to the above arguments, any jQuery/Zepto.ajax options argument
* can be specified as well.
@zmaril
zmaril / _colors.scss
Created February 24, 2012 18:48
Easy customization of octopress blogs
// If you need a handy color picker try http://hslpicker.com
// Or look at octopress/sass/base/solarized.scss for inspiration. The colors in there are excellent.
// The following are ordered in terms of vague importance.
//Pick your favorite color. If you picked a thoughtful blue, try again.
$main-color: #6c71c4;
//This controls the background.
$page-bg: lighten($main-color,20);
@bicherele
bicherele / csv-to-json.php
Created February 22, 2012 10:03 — forked from robflaherty/csv-to-json.php
Convert CSV to JSON
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed
# Cookbook Name:: mongodb
# Recipe:: default
case node['platform']
when "ubuntu"
execute "apt-get update" do
action :nothing
end
execute "add gpg key" do