Skip to content

Instantly share code, notes, and snippets.

View jemgold's full-sized avatar
👽
vibing

Jem jemgold

👽
vibing
View GitHub Profile
@jemgold
jemgold / 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
class Attending.EventsPosterView extends Batman.View
viewDidAppear: ->
console.log $('.poster__mega-image__image').attr('data-image')
MegaImage.setup()
setTimeout(->
console.log $('.poster__mega-image__image').attr('data-image')
MegaImage.setup()
, 50)
@jemgold
jemgold / vr.scss
Last active August 29, 2015 13:59 — forked from ry5n/-ry5n-vertical-rhythm
// 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

Keybase proof

I hereby claim:

  • I am jongd on github.
  • I am gold (https://keybase.io/gold) on keybase.
  • I have a public key whose fingerprint is AF6E B47D 5443 F36C BEFE 1061 D8DF B4C5 134C 6D44

To claim this, I am signing this object:

//
// IATBenHowdleViewController.m
// Visit
//
// Created by Jon Gold on 15/07/2014.
// Copyright (c) 2014 Internet & Things. All rights reserved.
//
#import "IATBenHowdleViewController.h"
#import "IATStore.h"
// https://[my-awesome-team].slack.com/team
$('#active_members .team_list_item').map(function(i, m) {
var name = $('.member_name', m).text().split(' ')
var email = $('a[title^="Email"]', m).text()
return [name, email].join(',')
}).toArray().join('\n');
r = 100
generatePolygon = (sides) ->
vertex(v, sides) for v in [0...sides]
vertex = (v, sides) ->
x = r * Math.cos(2 * Math.PI * v / sides)
y = r * Math.sin(2 * Math.PI * v / sides)
new Layer
x: x + 100