Skip to content

Instantly share code, notes, and snippets.

View brett-richardson's full-sized avatar

Brett Richardson brett-richardson

View GitHub Profile
class One
test: -> console.log 'test'
class @Two
test: -> console.log 'test'
@brett-richardson
brett-richardson / combined_enumerator.rb
Last active January 3, 2016 05:49
Combined Lazy Enumerator in Ruby 1.9
# The aim of this class is to take a number of ordered enumerators and then
# emit their values in ascending order.
#
# Some assumptions:
# * The enumerators passed in emit their values in ascending order.
# * The enumerators emit values which are Comparable[1] with each other.
# * The enumerators can be finite *or* infinite.
#
# This requires Ruby 1.9. The Enumerator[2] documentation might be useful.
#
ApplicationController < ActionController::Base
# Fetch the best location available to the app at the time
def fetch_location
if params[:location].present? # Geocode the manual location input
session[:manual_location] = Geokit::Geocoders::MultiGeocoder.geocode( params[:location] )
end
if session[:manual_location].present?
session[:manual_location]
@brett-richardson
brett-richardson / gist:1406212
Created November 29, 2011 20:01
vc_resumes_ajax_submit
function vc_resumes_ajax_submit(){
module_load_include( 'inc', 'vc_resumes', 'vc_resumes.fetch' );
module_load_include( 'inc', 'node', 'node.pages' );
global $user;
// dpm( $_REQUEST );
$form_id = $_REQUEST['form_id'];
$type = explode( '_', $form_id );
$type = $type[0]; /* This will not work with node types with a _ in their name */
@import '_variables';
.node-type-resume{
h1{
margin-top:$baseline !important;
.picture{ display:inline-block; margin-right:$gutter; }
a.edit_my_resume, a.back_to_profile{
@brett-richardson
brett-richardson / form.scss
Created November 6, 2011 14:05
BrewFans form SASS
form{
fieldset{
padding:$baseline*2 0 0 0; margin:$baseline*2 $baseline*2 $baseline*3 0;
border:0; border-top:1px solid rgba( 140, 140, 140, 0.35 );
legend{
position:relative; top:-2px; padding-right:$gutter;
color:$light_grey; font-weight:bold; font-size:$fsize_large; line-height:$lsize_large;
}
}