This file contains 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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
nullProperty: null, | |
undefinedProperty: undefined | |
}); |
This file contains 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
import Ember from 'ember'; | |
import { moduleForComponent } from 'ember-qunit'; | |
export default function (name, options={}) { | |
moduleForComponent(name, { | |
integration: true, | |
setup() { | |
this.select = function (from, text) { | |
let $el = this.$(from); | |
let $option = $el.find(`option:contains(${text})`); |
This file contains 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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
powPow: function() { | |
alert('POW POW POW!!!'); | |
}.on('didInsertElement') | |
}); |
This file contains 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
module Numbers | |
WEIRD = { | |
0 => "zero", | |
1 => "one", | |
2 => "two", | |
3 => "three", | |
4 => "four", | |
5 => "five", | |
6 => "six", | |
7 => "seven", |
This file contains 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
module Roman | |
MAP = { | |
1000 => "M", | |
900 => "CM", | |
500 => "D", | |
400 => "CD", | |
100 => "C", | |
90 => "XC", | |
50 => "L", | |
40 => "XL", |
This file contains 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
# Convert an integer into its English equivalent. | |
def in_words(int) | |
# Your glorious code here | |
end | |
### Test code | |
in_words(4) # => "four" | |
in_words(27) # => "twenty seven" | |
in_words(102) # => "one hundred two" |
This file contains 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
def to_roman(num) | |
results = "" | |
if num % 5 == 4 | |
if num > 5 | |
results = "IX" | |
else | |
results = "IV" | |
end | |
elsif num == 5 |
This file contains 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
### s3 implementation of Paperclip module that supports deep | |
### cloning of objects by copying image attachments. | |
### Refer to Paperclip issue: https://github.com/thoughtbot/paperclip/issues/1361#issuecomment-39684643 | |
### Original gist works with fog: https://gist.github.com/stereoscott/10011887 | |
module Paperclip | |
module CopyAttachments | |
def copy_attachments_from(source_obj, source_bucket = nil, destination_bucket = nil) | |
self.class.attachment_definitions.keys.each do |attachment_name| | |
source_attachment = source_obj.send(attachment_name) |
This file contains 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 var yoloInstagramRecentMediaJson = {"pagination":{"next_max_tag_id":"1414697845333930","deprecation_warning":"next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead","next_max_id":"1414697845333930","next_min_id":"1414697900707568","min_tag_id":"1414697900707568","next_url":"https:\/\/api.instagram.com\/v1\/tags\/yolo\/media\/recent?count=16\u0026callback=jQuery1111011989749874919653_1414697864571\u0026client_id=c9be10c8dce447049b4f6939d2532caf\u0026max_tag_id=1414697845333930\u0026_=1414697864572"},"meta":{"code":200},"data":[{"attribution":null,"tags":["beautiful","life","old","bestie","yolo","school","days","laugh","love","times","miss","perfect","forever","lame","friends","make","up","amazing","live","wonderful","cutie","adorable"],"location":null,"comments":{"count":0,"data":[]},"filter":"Normal","created_time":"1414697900","link":"http:\/\/instagram.com\/p\/uyeWEJQ9SB\/","likes":{"count":0,"data":[]},"images":{"low_resolution":{"url":"http:\/\/scontent-b.cd |
NewerOlder