This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export BUNDLER_EDITOR=mine | |
bundle open devise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listeners:{ | |
tap: { | |
element: 'element', | |
delegate: '.student-seat .doc-box, .bubble-holder', | |
fn: function(e){ | |
var me = this; | |
var url = e.target.name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listeners: { | |
tap: { | |
element: 'element', | |
delegate: '.app-box, .doc-box, .bubble-holder', | |
fn: function(e){ | |
var url = e.target.name | |
, name = e.delegatedTarget.textContent | |
, divClassName = e.delegatedTarget.className |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scrollable: { | |
fps: 'auto', | |
direction : 'vertical', | |
directionLock: true, | |
indicators: false, | |
momentumEasing: { | |
momentum: { | |
acceleration: 30, // how slowly it stops - high # = stops less | |
friction: 0.7 // stick factor | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!env ruby | |
require 'optparse' | |
require 'yaml' | |
DESTINATION_DIRECTORY = './www' | |
options = {} | |
OptionParser.new do |opts| | |
opts.banner = "Usage: clone_www.rb [options]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tap: { | |
element: 'element', | |
delegate: '.app-box, .doc-box, .bubble-holder', | |
fn: function(e){ | |
var url = e.target.name, | |
name = e.delegatedTarget.textContent, | |
divClassName = e.delegatedTarget.className, | |
appbox = "app-box", | |
docbox = "doc-box", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dues: function (expiresdate){ | |
var now = moment(), | |
due = moment(expiresdate).format("YYYY-MM-DD"), | |
todayMoment = moment().format("YYYY-MM-DD"), | |
dueFormatted = moment(expiresdate).format("MMMM Do YYYY"), | |
tmrw, yest, | |
dueInfo = { | |
color: '', | |
text: '' | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listeners: { | |
swipe: { | |
element: 'element', | |
fn: function (e) { | |
var direction = e.direction, | |
feednav = Ext.ComponentQuery.query('FeederNav')[0]; | |
if (direction == 'right') { | |
feednav.reset(); |
OlderNewer