Skip to content

Instantly share code, notes, and snippets.


Orlin M Bozhinov orlin

  • Astrolet
  • Varna, Bulgaria
  • Twitter @orlin
View GitHub Profile
View gist:160263
echo "Setting up chef..."
sudo apt-get -y update
sudo apt-get -y install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert
cd /tmp
tar zxf rubygems-1.3.4.tgz
View deploy.rake
task :deploy => ['deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
task :migrations => [:push, :off, :migrate, :restart, :on, :tag]
task :rollback => [:off, :push_previous, :restart, :on]
task :push do
puts 'Deploying site to Heroku ...'
puts `git push heroku`
View debug.js
require.registerExtension('.js', function(js){
return js.replace(/^ *\/\/debug: */gm, '');
seancribbs /
Created Jan 7, 2011
WIP port of Ripple's Riak::TestServer to riak-js
$ node ts.js
10 Jan 15:01:23 - prepared
10 Jan 15:01:24 - started
PUT /riak/airlines/KLM
10 Jan 15:01:24 - saved
10 Jan 15:01:24 - cleared
GET /riak/airlines/KLM
10 Jan 15:01:24 - not found! it works
jbz / knife.rb
Created Feb 16, 2011
knife.rb that switches Opscode orgs/validators based on git branch
View knife.rb
# This knife.rb orig. provided by - but any mistakes are mine!
current_dir = File.dirname(__FILE__)
platform = ""
require 'grit'
branch ="#{current_dir}/..")
case branch
View require-json.js
require.extensions[".json"] = function (module, filename) {
module.exports = JSON.parse(require("fs").readFileSync(filename, "utf8"))
topfunky / Cakefile
Created Apr 14, 2011
Watch both Sass and Coffee files and compile on change (for Node.js)
View Cakefile
Modified from
Part of an upcoming PeepCode screencast. This snippet is MIT Licensed.
{spawn, exec} = require 'child_process'
task 'assets:watch', 'Watch source files and build JS & CSS', (options) ->
runCommand = (name, args) ->
jboesch / AjaxForm Jasmine Test.js
Created Apr 20, 2011
RequireJS, BackboneJS and testing with Jasmine. Whew.
View AjaxForm Jasmine Test.js
describe("AjaxForm", function() {
// Local vars for manipulation
var $form = null,
_requirejs_loaded = false,
found_errors = false,
submitted_successfully = false,
AjaxFormInstance = null,
RequireJSViews = {
AjaxFormView: null
# Extend jQuery objects with Underscore collection methods.
# Each collection method comes in two flavors: one prefixed
# with _, which yields a bare DOM element, and one prefixed
# with $, which yields a jQuery-wrapped element.
# So if `this` is a jQuery object, instead of:
# _.max @, (el) -> $(el).height()
View gist:950965
# Conditional decrement.
# Decrement the value of a key only if the current value is greater than
# a specified value.
require 'rubygems'
require 'redis'
r =
cond_decr = <<LUA