Skip to content

Instantly share code, notes, and snippets.

View jem-computer's full-sized avatar
🌈

Jem jem-computer

🌈
View GitHub Profile
@jem-computer
jem-computer / Puppetfile
Created February 28, 2013 12:56
keep getting errors - could not find class X for macbook.local on node macbook.local
# Optional/custom modules. There are tons available at
# https://github.com/boxen.
github "notational_velocity", "1.0.0"
github "dropbox", "1.0.0"
github "onepassword", "1.0.0"
github "chrome", "1.0.0"
github "mongodb", "1.0.0"
github "sublime_text_2", "1.0.0"
github "spotify", "1.0.0"
class Twitter
constructor: (options) ->
@_url = "https://api.twitter.com"
@_version = "1.1"
_.extend this, options if options
_getUrl: (url) ->
[@_url, @_version, url].join "/"
get: (url, params) ->
/*
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;
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
/**
* Generics
* Imports and stuff.
*/
@import "generic/defaults";
@import "susy";
@import "generic/normalize";
@import "generic/reset";
var five = require('../lib/johnny-five.js'),
board, button;
board = new five.Board();
board.on("ready", function() {
this.firmata.sendI2CConfig();
var LSM303_CTRL_REG1_A = 0x20
, LSM303_CTRL_REG2_A = 0x21
@jem-computer
jem-computer / new.m
Created February 10, 2014 12:58
ObjectiveDDP + ReactiveCocoa
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:MeteorClientDidConnectNotification object:nil] subscribeNext:^(id x) {
NSLog(@"connected to server!");
}];
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:MeteorClientDidDisconnectNotification object:nil] subscribeNext:^(id x) {
NSLog(@"disconnected from server!");
}];
return YES;
- (void)thing
{
// So I have two signals…
RACSignal *addedSignal = [[NSNotificationCenter defaultCenter] rac_addObserverForName:@"added" object:nil];
RACSignal *removedSignal = [[NSNotificationCenter defaultCenter] rac_addObserverForName:@"removed" object:nil];
// This doesn't get called until removedSignal gets it's first thingy.
[[RACSignal combineLatest:@[addedSignal, removedSignal]] subscribeNext:^(id x) {
// TODO could this binding be better?
[self.data replaceObjectAtIndex:0 withObject:self.meteorClient.collections[@"posts"]];
Batman.DOM.nodeIsEditable = (node) ->
if node.nodeName.toUpperCase() in ['INPUT', 'TEXTAREA', 'SELECT'] or node.hasAttribute('contenteditable')
return true
else return false
Batman.DOM.events.change = (node, callback, view) ->
eventNames = switch node.nodeName.toUpperCase()
when 'TEXTAREA' then ['input', 'keyup', 'change']
when 'INPUT'
if node.type.toLowerCase() in Batman.DOM.textInputTypes