Skip to content

Instantly share code, notes, and snippets.

@maccman
maccman / juggernaut_heroku.md
Created June 2, 2011 01:26
Juggernaut on Heroku

Clone repo:

git clone git://github.com/maccman/juggernaut.git
cd juggernaut

Create Heroku app:

heroku create myapp --stack cedar
heroku addons:add redistogo:nano

git push heroku master

@brentertz
brentertz / gist:1061741
Created July 2, 2011 22:42
Google analytics async snippet - in haml
-# mathiasbynens.be/notes/async-analytics-snippet
:javascript
var _gaq=[['_setAccount',"#{ENV['GOOGLE_ANALYTICS_ID']}"],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
@nsxdavid
nsxdavid / Scale9SPrite.m
Created July 27, 2011 04:35
Scale9Sprite - A Cocos2d 9-Slice Sprite
//
// Scale9Sprite.m
//
// Creates a 9-slice sprite.
#import "Scale9Sprite.h"
@rriemann
rriemann / pastie.rb
Created November 22, 2011 14:38
Paste script to paste to pastie.org from command line. Written in ruby
#!/usr/bin/env ruby
# kate: remove-trailing-space on; replace-trailing-space-save on; indent-width 2; indent-mode ruby; syntax ruby;
require 'net/http'
require 'optparse'
require 'timeout'
require 'cgi'
require 'uri'
class Hash
@haldun
haldun / quiet_assets.rb
Created December 9, 2011 16:38
rails remove assets logs
Rails.application.assets.logger = Logger.new('/dev/null')
Rails::Rack::Logger.class_eval do
def before_dispatch_with_quiet_assets(env)
before_dispatch_without_quiet_assets(env) unless env['PATH_INFO'].index("/assets/") == 0
end
alias_method_chain :before_dispatch, :quiet_assets
end
@psineur
psineur / UIWebViewWithDebug.m
Created December 12, 2011 17:35
UIWebView with js Debugger.
/** @class UIWebViewWithDebug UIWebView with additional js error on DEBUG.
* Tested on iPad with 4.3.5 & 5.0
*/
@interface UIWebViewWithDebug : UIWebView {} @end
#ifdef DEBUG
@class WebView;
@class WebScriptCallFrame;
@class WebFrame;
@gburd
gburd / haproxy.conf
Last active January 22, 2025 20:17
Recommended haproxy settings to balance Riak protobuf and http interfaces (note: WORK IN PROGRESS)
# Documentation for HAProxy
# http://code.google.com/p/haproxy-docs/w/list
# http://haproxy.1wt.eu/download/1.2/doc/architecture.txt
# NOTES:
# open files limits need to be > 256000, use ulimit -n to set (on most POSIX systems)
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
@l4u
l4u / gist:1611418
Created January 14, 2012 13:28
heroku snippets
heroku create --stack cedar
heroku rename new_app
heroku create new_app --stack cedar
heroku addons:add logging:expanded
heroku addons:upgrade logging:expanded
http://devcenter.heroku.com/articles/mongolab
heroku addons:add mongolab:starter
# config/initializers/active_admin_mongoid_patch.rb
require "active_admin"
require "active_admin/resource_controller"
require 'ostruct'
module ActiveAdmin
class Namespace
# Disable comments
def comments?
@mrrooijen
mrrooijen / .gitignore
Created February 1, 2012 18:04
MiddleMan on Heroku configuration.
.DS_Store
*.swp
*.swo
Gemfile.lock