Skip to content

Instantly share code, notes, and snippets.

@fleetio
fleetio / README.markdown
Created October 1, 2012 06:04 — forked from gudbergur/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@fleetio
fleetio / README.markdown
Created July 8, 2012 20:27 — forked from Yavari/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@fleetio
fleetio / application.html.haml
Created July 3, 2012 19:25
Rails helper method that determines if an asset exists
- if asset_exists? "#{params[:controller]}.css"
= stylesheet_link_tag params[:controller]
- if asset_exists? "#{params[:controller]}.js"
= javascript_include_tag params[:controller]
@fleetio
fleetio / application.rb
Created October 21, 2011 03:30 — forked from ryansch/hooks_controller.rb
Rails Controller for Chargify Webhooks
# Add to the bottom of your application.rb file:
require 'digest/md5'
@fleetio
fleetio / quantity_based_component.rb
Created October 18, 2011 20:11
Creating a quantity_based_component through Chargify API
def setup_components
response = HTTParty.post("#{Chargify.site}/product_families/#{[product_family_id]}/quantity_based_components.json",
:body => component_attributes.as_json,
:basic_auth => {:username => Chargify.api_key, :password => 'X'})
response.code.should == 201
end
def component_attributes
{
@fleetio
fleetio / .gemrc
Created September 19, 2011 17:56
Better .gemrc settings for rdocs
rdoc: --inline-source --line-numbers --format=html --template=hanna --main README.rdoc README.rdoc README.md README.textile README.markdown README.txt README