Skip to content

Instantly share code, notes, and snippets.

@jdjkelly
jdjkelly / gist:8838705
Created February 6, 2014 05:12
011314_challenge_148_easy_combination_lock
var input = [5, 1, 2, 3],
digit_count = input.shift()
digit_count * 4 + input[0] * 2 - input[1] * 2 + input[2]
@jdjkelly
jdjkelly / gist:9906676
Created April 1, 2014 02:40
Ember App Kit Initializer Example for Injecting Current User into Controllers
import Session from 'appkit/models/session';
export default Ember.Application.initializer({
name: 'currentUser',
initialize: function(container, app) {
// Register a new container
container.register('session:current-user', Session);
// Load the current user
container.lookup('session:current-user').find();
@jdjkelly
jdjkelly / gist:613d665aec1dcc3736bd
Created May 17, 2014 19:18
Active Ember.Select Issues and PRs
https://github.com/emberjs/ember.js/issues/2386
https://github.com/emberjs/ember.js/issues/2907
https://github.com/emberjs/ember.js/issues/3173
https://github.com/emberjs/ember.js/issues/3732
https://github.com/emberjs/ember.js/issues/4150
https://github.com/emberjs/ember.js/issues/4331
https://github.com/emberjs/ember.js/issues/4422
https://github.com/emberjs/ember.js/pull/2461
https://github.com/emberjs/ember.js/pull/4226
name:Mason
data:{"templateID":"01-mason","originalName":"Mason","backgroundColour":"fbfbfb","header":{"type":"header","displayType":"image","contents":null,"alt":null,"href":null,"originalWidth":0,"originalHeight":0,"width":0,"height":0,"fileName":null},"footer":{"type":"footer"},"social":{"tweet":{"on":true},"fblike":{"type":"Like this email","href":null,"on":true},"webversion":{"on":true},"forwardtoafriend":{"on":true},"preferences":{"on":true}},"sections":[{"id":"full-width","content":[{"content":[{"contents":"<h1>Start designing your email</h1><p>Add new pieces of content like text, images and buttons to your email by dragging the tiles on the left where you want them to go.</p><p>Add different layouts to your email by clicking on the green <strong>Add layout</strong> button below.</p>","type":"text","validation":null}]}],"readOnly":false},{"id":"3-col","content":[{"content":[{"type":"image","isFullWidth":true,"alt":"","fileName":"","halign":"center","href":"","originalWidth":0,"originalHeight":0,"validat
{
"templateID": "01-mason",
"originalName": "Mason",
"backgroundColour": "fbfbfb",
"header": {
"type": "header",
"displayType": "image",
"contents": null,
"alt": null,
"href": null,
data[EventSetting][autosave]:1
data[EventSetting][layout][group][0][group][0][group][0][bgimage]:/img/events//img/events/events/splash/DSC_5839.jpg
data[EventSetting][layout][group][0][group][0][group][0][eventImage]:true
data[EventSetting][layout][group][0][group][0][group][0][group][0][class]:stretchBox
data[EventSetting][layout][group][0][group][0][group][0][group][0][group][0][element]:title
data[EventSetting][layout][group][0][group][0][group][0][group][0][group][0][styles][padding-left]:0em
data[EventSetting][layout][group][0][group][0][group][0][group][0][group][0][class]:
data[EventSetting][layout][group][0][group][0][group][0][group][0][group][1][element]:subtitle
data[EventSetting][layout][group][0][group][0][group][0][group][0][group][1][styles][padding-left]:0em
data[EventSetting][layout][group][0][group][0][group][0][group][0][group][1][styles][padding-top]:0em
class ObjectBuilder
def prototype(proto)
# Leave method implementations on the proto object
ivars = proto.instance_variables.reject{ |ivar_name|
proto.respond_to?(ivar_name.to_s[1..-1]) &&
proto.instance_variable_get(ivar_name).is_a?(Proc)
}
ivars.each do |ivar_name|
unless @object.instance_variable_defined?(ivar_name)
@object.instance_variable_set(
@jdjkelly
jdjkelly / gist:de3a3873175186c8e562
Last active August 29, 2015 14:06
How to track events emitted by Uniiverse.com's Direct Payments Platform
// Include, and initialize analytics
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXX-Y', 'auto');
ga('send', 'pageview');

"Gamergate is a collective response to an epochal narrowing of human experience to the point where the only things we care to defend are consumer goods, distraction apparatuses whose reassuring simulations of progress and accomplishment must be sanctified because they can no longer imagine living without them."

Once, the Hassidic rabbi Zusya came to his followers with tears in his eyes. They asked him:

"Zusya, what's the matter?

And he told them about his vision; "I learned the question that the angels will one day ask me about my life."

The followers were puzzled. "Zusya, you are pious. You are scholarly and humble. You have helped so many of us. What question about your life could be so terrifying that you would be frightened to answer it?"

Zusya replied; "I have learned that the angels will not ask me, 'Why weren't you a Moses, leading your people out of slavery?' and that the angels will not ask me, 'Why weren't you a Joshua, leading your people into the promised land?"' Zusya sighed; "They will say to me, 'Zusya, why weren't you Zusya?'"