Skip to content

Instantly share code, notes, and snippets.

jQuery(($) => {
$("#menu-toggle").click((evt) => {
evt.preventDefault();
$('.menu-activable').toggleClass('menu-active');
return false;
});
});

Keybase proof

I hereby claim:

  • I am rudyjahchan on github.
  • I am rudy (https://keybase.io/rudy) on keybase.
  • I have a public key ASBlzEffWUxHOm2z9XLUaj20HHPIhB9CN25nOVBQClN5Cwo

To claim this, I am signing this object:

@rudyjahchan
rudyjahchan / TimeHelper.swift
Last active November 2, 2016 06:16
A playground to get easy helpers for dates
//: Playground - noun: a place where people can play
import Foundation
extension DateComponents {
static prefix func - (components: DateComponents) -> DateComponents {
var newComponents = DateComponents()
newComponents.calendar = components.calendar
newComponents.timeZone = components.timeZone
@rudyjahchan
rudyjahchan / Experiment1.swift
Last active October 27, 2016 17:10
Experiments in typing
//: Playground - noun: a place where people can play
import UIKit
protocol HasCreatedAtTimestamp {
var createdAt: Date { get }
func setCreatedAt(date: Date) -> Self
}
//: Playground - noun: a place where people can play
import UIKit
typealias Properties = Dictionary<String,Any?>
struct TypeKey {
let type: Any.Type
}
@rudyjahchan
rudyjahchan / deadly.js
Created July 20, 2016 13:51
A-Frame Deadly Component
import Component from '../core/component';
export default class Deadly extends Component {
init() {
this.el.addEventListener('collide', e => this.onCollision(e));
}
onCollision(event) {
event.detail.body.el.emit('death', event);
}
RAC(self, 'titleLabel.text') =
[self.selectedRegion map:^NSString*(WTFRegion *region) {
return region.title;
}];
RACSignal *regionRect = [self.selectedRegion map:^NSValue*(WTFRegion *region) {
return [NSValue valueFromMKMapRect:region.rect];
}];
[self.mapView rac_liftSelector:@selector(setVisibleMapRect:animated:)
withSignals:regionRect, [RACSignal return:@(YES)], nil];
RACSignal *annotations = [self rac_liftSelector: @selector(fetchAnnotationsForRegion:)
withSignals: selectedRegionSignal, nil];
[self.mapView rac_liftSelector:@selector(addAnnotations:)
withSignals:annotations, nil];
__weak id weakSelf = self;
RACSignal *annotations = [self.selectedRegion map:^NSArray*(WTFRegion *region) {
id strongSelf = self;
return [strongSelf fetchAnnotationsForRegion:region];
}];
[self.mapView rac_liftSelector:@selector(addAnnotations:)
withSignals:annotations, nil];
RACSignal *regionRect = [self.selectedRegion map:^NSValue*(WTFRegion *region) {
return [NSValue valueFromMKMapRect:region.rect];
}];
[self.mapView rac_liftSelector:@selector(setVisibleMapRect:animated:)
withSignals:regionRect, [RACSignal return:@(YES)], nil];