Skip to content

Instantly share code, notes, and snippets.

@njvitto
njvitto / deploy.rake
Created April 11, 2010 16:56 — forked from RSpace/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
// jslint.js
// 2010-08-08
/*
Copyright (c) 2002 Douglas Crockford (www.JSLint.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
" by CJ Lazell github.com/cj
" based on - http://github.com/solars/github-vim/
if exists("loaded_github") || &cp
finish
endif
" --- main functions --- "
@cj
cj / index.html
Created July 14, 2011 12:36 — forked from jonalter/index.html
Titanium Desktop file upload example
<html>
<head></head>
<body style="background-color:#ffffff;margin:10px">
<script>
var uploadFile = function(){
var text = document.getElementById('txt');
var dir = Titanium.Filesystem.getResourcesDirectory();
sep = Titanium.Filesystem.getSeparator(),
// filename = 'test.txt',
@cj
cj / readme.md
Created August 10, 2011 13:11
hifi ajax-form snippet

Examples

Basic example, replace .ajax-form with whatever form you want to select:

$('.ajax-form').snippet_ajax_form();

Example using options:

$.fn.snippet_ajax_form.defaults= { hide_on_success: true };

@cj
cj / express_app.coffee
Created September 3, 2011 21:31 — forked from tanepiper/express_app.coffee
CoffeeScript version of the default expressjs application generated by express
# Module Dependencies
express = require 'express'
app = module.exports = express.createServer();
# Configuration
app.configure () ->
app.set 'views', "#{__dirname}/views"
app.set 'view engine', 'jade'
@andreaseger
andreaseger / config-initializers-resque.rb
Created September 6, 2011 14:17
carrierwave resque background image processing foo
rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..'
rails_env = ENV['RAILS_ENV'] || 'development'
resque_config = YAML.load_file(rails_root + '/config/resque.yml')
Resque.redis = resque_config[rails_env]
#secure the admin view of resque
Resque::Server.use(Rack::Auth::Basic) do |user, password|
password == "secret"
end
@cj
cj / gist:1234672
Created September 22, 2011 12:44
Node.js Campfire bot
// main app.js
var client = require('ranger').createClient('ROOM',
'SECRET');
var timestamp = require('./timestamp').timestamp;
var getWeatherWrapper = require('./weather').getWeatherWrapper;
var showMap = require('./map').showMap;
var getTweets = require('./tweets').getTweets;
client.room(ROOMID, function(room) {
@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@cj
cj / gemspec-usage.md
Created March 3, 2012 03:56 — forked from holman/gemspec-usage.md
test/spec/mini

Just install this in your apps like so:

gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'