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
// ---- | |
// Sass (v3.4.9) | |
// Compass (v1.0.1) | |
// ---- | |
$media-break: 1024px; | |
@function vw($px, $base-width: $media-break){ | |
@return ($px /$base-width) * 100vw; | |
} |
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
extension String { | |
func toDate(format: String) -> NSDate? { | |
let dateFormatter = NSDateFormatter() | |
dateFormatter.dateFormat = format | |
return dateFormatter.dateFromString(self) | |
} | |
} | |
extension NSDate { | |
func toString(format: String) -> String { |
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 FoodTableViewCell: UITableViewCell { | |
@IBOutlet weak var nameLabe: UILabel! | |
@IBOutlet weak var checkbox: CheckBox! | |
} |
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
//: # Ruby Array push | |
func << <T>(inout left: [T], right: T) -> [T] { | |
left.append(right) | |
return left | |
} | |
func << <T>(inout left: [T], right: [T]) -> [T] { | |
left += right | |
return left | |
} |
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
// ---- | |
// Sass (v3.4.14) | |
// Compass (v1.0.3) | |
// ---- | |
@mixin theme($themename, $color1, $color2) { | |
.#{$themename} { | |
.button { | |
color: $color1; | |
} |
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
var EventDispatcher = (function(){ | |
function EventDispatcher(){ | |
this._listeners = {}; | |
} | |
EventDispatcher.prototype.dispatchEvent = function(event, data){ | |
var _this = this; | |
if(!this._listeners || !this._listeners[event]) return; | |
this._listeners[event].forEach(function(callback){ |
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
import Ember from 'ember'; | |
var {observer, on} = Ember; | |
export default Ember.Component.extend({ | |
item: null, | |
text: "not updated", | |
update: observer('item', function(){ | |
this.set('text', 'update'); | |
}), | |
update2: on('didInitAttrs', observer('item', function(){ |
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
{ | |
"data": [ | |
{ | |
"category": "Item.News", | |
"item":{ | |
"id": 16, | |
"title": "Grosvenor Fund Management appoints Gaston Brandes", | |
"subtitle": "Gaston Brandes joins from UBS Global Asset Management to bolster Capital Raising team", | |
"date": "2015-09-02T00:00:00", | |
"image": {}, |
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
var generator = publishLevel(12, {data: true}) | |
load.call(generator) | |
function* publishLevel(user_id, level_data) { | |
var user = yield getUser(user_id) | |
console.log(user) | |
var can_create = yield canCreate(user) | |
console.log(can_create) | |
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
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model: function () { | |
return {}; | |
} | |
firstName: null, | |
lastName: null, | |
fullName: Ember.computed('firstName', 'lastName', function() { | |
return this.get('firstName') + ' ' + this.get('lastName'); |