Skip to content

Instantly share code, notes, and snippets.

# Pseudo Code
# Current Approach
angular.module('tab', []).controller, BetBuilderCtrl
angular.module('tab', []).controller, HeaderCtrl
angular.module('tab', []).directive, DropDown
%body{ ng_app: 'tab' }
%div{ ng_controller: 'HeaderCtrl' }
@immer
immer / base_document.rb
Created April 8, 2014 13:19
Sample code for Reserve's perusal (Ruby)
module Futures
module Document
class Base
def initialize(body)
@body = body
end
def selector
''
/*! photo_factory - v0.0.0 - 2014-09-19
* Copyright (c) 2014 ; Licensed */
window.Device=function(){function a(a){var b=a||{};this.width=b.width,this.height=b.height,this.within=function(a){return this.width>a.min&&this.width<a.max}}function b(b){a.call(this,b),this.isPhone=function(){return!(this.isDesktop()||this.isTablet())},this.isTablet=function(){return!this.isDesktop()&&this.within({min:768,max:1024})},this.isDesktop=function(){return this.within({min:1024,max:1/0})}}return b}(),window.Factory=function(a){function b(b){function c(c){return new window.ResponsivePhoto(a(c),b.device)}function d(b){return new window.LazyPhoto(a(b))}var e=Array.prototype.forEach;this.constructResponsivePhotos=function(){return e.call(b.responsive_photos,c),b.responsive_photos},this.constructLazyPhotos=function(){return e.call(b.lazy_photos,d),b.lazy_photos}}return b}(window.jQuery),window.LazyPhoto=function(){function a(a){return a.lazyload({threshold:200,skip_invisible:!1})}return a}(),function(a,b,c){c(b).ready(function(
class Taxonomy
...
def seo_optimized_title
pluralize? ? self['seo_slug_pluralized'] : self['seo_slug_singular']
end
def pluralize?
Filter.all.each do |tax|
@immer
immer / thing.js
Last active August 29, 2015 14:16
var Queue = (function() {
var Queue;
Queue = function() {
var add,
freshQueue,
queue,
process;
require 'base64'
BYE = "\nCongratz"
TARGET = "[email protected]"
WELCOME = "What's the solution?"
joker = -> do
puts BYE or exit if gets.sub("\n", '') == TARGET
puts @messages.sample
joker.()
{"object_id"=>"df630383-eabb-4690-bb72-a44400a55038",
"object_type"=>"vendor",
"application_id"=>"e649b945-caf5-4d94-b192-fb3e87ffeadf",
"title"=>"The Crofoot Ballroom",
"description"=>"",
"image_url"=>"",
"url"=>"/marketplace/the-crofoot-ballroom-pontiac-mi-850693",
"Location"=>
{"address_1"=>"1 S SAGINAW ST",
"address_2"=>nil,
@immer
immer / report.rb
Last active August 29, 2015 14:22
require "csv"
DATA = %Q{Capacity,MonthlyPrice,StartDay,EndDay
1,600,2014-07-01,
1,400,2014-04-02,
1,400,2014-05-01,
5,2800,2014-03-01,2014-04-30
2,1500,2014-05-01,2014-06-30
4,1700,2014-04-01,
3,1300,2014-04-01,
#!/bin/sh
brew cask install google-chrome
brew cask install hipchat
brew cask install slack
brew cask install skype
brew cask install alfred
brew cask install java
brew cask install soundflower
Thing = Struct.new(:foo, :bar)
list = 10.times.map { |i| Thing.new(i, rand(1000)) }
list << Thing.new(nil, rand(1000))
puts list.sort_by!(&:bar)