Skip to content

Instantly share code, notes, and snippets.

View ivanvanderbyl's full-sized avatar
🏝️

Ivan Vanderbyl ivanvanderbyl

🏝️
View GitHub Profile
@ivanvanderbyl
ivanvanderbyl / gist:784200
Created January 18, 2011 09:33
Metaprogramming my DSLs
class SandwichMaker
end
class SandwichEater
end
module Cloudist
class << self
# !/usr/bin/env ruby
#
# A pre-commit hook to test if jammit needs to be run
# In case you don't like on the fly stuff
require 'rubygems'
require "bundler"
Bundler.setup
require 'jammit'
# Be sure to restart your server when you modify this file.
#
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActionController::Base.wrap_parameters format: [:json]
# Disable root element in JSON by default.
if defined?(ActiveRecord)
@ivanvanderbyl
ivanvanderbyl / bootstrap_formbuilder.rb
Created November 3, 2011 03:42
BootstrampFormBuilder
module Formtastic
class BootstrapFormbuilder < SemanticFormBuilder
def basic_input_helper(form_helper_method, type, method, options) #:nodoc:
html_options = options.delete(:input_html) || {}
html_options = default_string_options(method, type).merge(html_options) if [:numeric, :string, :password, :text, :phone, :search, :url, :email].include?(type)
field_id = generate_html_id(method, "")
html_options[:id] ||= field_id
label_options = options_for_label(options)
label_options[:for] ||= html_options[:id]
<%
require 'cgi'
require 'uri'
begin
uri = URI.parse(ENV["DATABASE_URL"])
rescue URI::InvalidURIError
raise "Invalid DATABASE_URL"
end
Bundle 'gmarik/vundle'
Bundle 'scrooloose/nerdtree'
Bundle 'scrooloose/syntastic'
Bundle 'nathanaelkane/vim-command-w'
Bundle 'nathanaelkane/vim-indent-guides'
Bundle 'nathanaelkane/Command-T'
Bundle 'bronson/vim-trailing-whitespace'
Bundle 'tpope/vim-surround'
Bundle 'tpope/vim-rails'
Bundle 'tpope/vim-fugitive'
require 'iron_worker'
require_relative 'worker'
IronWorker.configure do |config|
config.token = ''
config.project_id = ''
config.bundle=true
end
worker = TestPilot::Iron::Worker.new
@ivanvanderbyl
ivanvanderbyl / animatable_view.js
Created June 16, 2012 09:13 — forked from johanvalcoog/animatable_view.js
Control Animations on Ember Views
AnimatableView = Ember.ContainerView.extend(Em.Animatable,{
executeAnimation: function() {
.......
this.animate({duration: that.duration, stopEventHandling:true}, function() {
# perform animations based on your JS choices
move('#'+id)
.x(translatePosition)
@ivanvanderbyl
ivanvanderbyl / UI.ListView.js
Created June 28, 2012 02:12 — forked from guilhermeaiolfi/UI.ListView.js
ListView widget for ember.js
var get = Ember.get, set = Ember.set;
UI = {};
UI.ListView = Em.CollectionView.extend({
tagName: "ul",
viewName: 'ListViewContainer',
classNames: ["ember-listview"],
attributeBindings: ['tabindex', 'unselectable'],
unselectable: 'on',
tabindex: 0,
mode: 'single',
@ivanvanderbyl
ivanvanderbyl / database.yml
Created July 2, 2012 03:49
Capsitrano deploy script for deploying to an 'ivanvanderbyl:application deployed' server.
production:
adapter: postgresql
encoding: unicode
database: my_application
pool: 5
host: 127.0.0.1