Skip to content

Instantly share code, notes, and snippets.

View jforaker's full-sized avatar

Jake Foraker jforaker

View GitHub Profile
@jforaker
jforaker / SeatingChart.js
Created April 7, 2014 15:11
Sencha Touch multiple listeners on XTemplate DOM elements
listeners:{
tap: {
element: 'element',
delegate: '.student-seat .doc-box, .bubble-holder',
fn: function(e){
var me = this;
var url = e.target.name
@jforaker
jforaker / devise_controller.rb
Created March 12, 2014 19:27
open gem file
export BUNDLER_EDITOR=mine
bundle open devise
class Story < ActiveRecord::Base
validates :title, :link, :category, :upvotes, presence: true
scope :popular, -> { where('upvotes >= ?', 4)}
scope :recent, -> { where('created_at >= ?', Date.today)}
def self.search_for(query)
where('title LIKE :query OR category LIKE :query', query: "%#{query}%")
end
end
@jforaker
jforaker / 0_reuse_code.js
Created October 23, 2013 16:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console