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
class Class { | |
constructor(ivars = []) { | |
const uniqueClassName = "fetchDelegate_" + NSUUID.UUID().UUIDString(); | |
const cls = MOClassDescription.allocateDescriptionForClassWithName_superclass_(uniqueClassName, NSObject); | |
const prototype = Object.getPrototypeOf(this); | |
Object.getOwnPropertyNames(prototype).forEach(prop => { | |
console.log(prop); | |
const sel = NSSelectorFromString(prop); | |
cls.addInstanceMethodWithSelector_function_(sel, prototype[prop]); |
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
// Make a class with some handlers. | |
function Class(handlers){ | |
var uniqueClassName = "fetchDelegate_" + NSUUID.UUID().UUIDString(); | |
var cls = MOClassDescription.allocateDescriptionForClassWithName_superclass_(uniqueClassName, NSObject); | |
// Add each handler to the class description | |
for(var selectorString in handlers) { | |
var sel = NSSelectorFromString(selectorString); | |
cls.addInstanceMethodWithSelector_function_(sel, handlers[selectorString]); | |
} | |
// Add ivar to store instance-specific info |
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
// Configurable variables | |
// ⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻ | |
// Absolute height of body text, in pixels | |
$base-font-size: 16px !default; | |
// Absolute height of one line of type, in pixels | |
$base-line-height: 24px !default; | |
// The font unit to use when returning values in rhythm functions |
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
App.RadClass = Em.Object.extend( | |
itemId: ((key, value)-> | |
if arguments.length == 2 and value | |
name = value.split(' ') | |
@set('firstName', name[0]) | |
@set('lastName', name.slice(1).join(' ')) | |
if @get('firstName') or @get('lastName') | |
"#{@get('firstName')} #{@get('lastName')}" | |
else |
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
/* | |
ISO 216 paper sizes converted to pixels @ 300dpi | |
Drop this file in your Processing sketch and use like so: size(A1w, A1h); | |
*/ | |
final int A5w = 1748; | |
final int A5h = 2480; | |
final int A4w = 2480; |
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
# config/initializers/ | |
Mongoid::Document.send(:include, ActiveModel::SerializerSupport) | |
Mongoid::Criteria.delegate(:active_model_serializer, to: :to_a) |
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
// Fairly safe way to visually hide content, but make it accessible to screen readers | |
.visually-hidden { | |
position: absolute; | |
left: -9999px; | |
height: 1px; | |
} | |
.mobile-offscreen { | |
@media screen and (max-width: 700px) { | |
@extend .visually-hidden; |
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
directory "tmp" | |
file "tmp/hello.tmp" => "tmp" do | |
sh "echo 'Hello' > 'tmp/hello.tmp'" | |
end | |
task :default => 'morning:turn_off_alarm' | |
namespace :morning do | |
desc "Turn off alarm." |