Skip to content

Instantly share code, notes, and snippets.

@melito
melito / html5uploader.coffee
Created March 18, 2012 05:20
Coffee Script html5 uploader
class HTML5Uploader
constructor:(obj, options) ->
@method = options['method'] ||= "POST"
@url = options['url'] ||= "/"
@params = options['params']
@obj = $(obj)
@files = []
@alerted = false
@jamiehodge
jamiehodge / Gemfile
Created January 15, 2012 22:37
Spine.js contacts demo Sinatra backend
source 'https://rubygems.org'
gem 'sinatra', git: 'git://github.com/sinatra/sinatra.git'
gem 'sequel'
gem 'sqlite3'
gem 'yajl-ruby', require: 'yajl'
@tmaier
tmaier / bootstrap_topbar_list.rb
Created January 2, 2012 11:08
BootstrapTopbarList for simple-navigation and Twitter Bootstrap integration
# Renders an ItemContainer as a <ul> element and its containing items as <li> elements.
# Prepared to use inside the topbar of Twitter Bootstrap http://twitter.github.com/bootstrap/#navigation
#
# Register the renderer and use following code in your view:
# render_navigation(level: 1..2, renderer: :bootstrap_topbar_list, expand_all: true)
class BootstrapTopbarList < SimpleNavigation::Renderer::Base
def render(item_container)
if options[:is_subnavigation]
ul_class = "dropdown-menu"
@cblunt
cblunt / Gemfile
Created October 21, 2011 08:55
Configure Carrierwave for Amazon S3 Storage and Heroku
# ...
gem 'carrierwave'
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
$("#media_items").html5Uploader({
url: "<%= assets_path %>",
method: 'POST',
params: {
authenticity_token: "<%= form_authenticity_token %>"
}
});