View application.controller.js
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |
View test_helpers.js
var pretender; | |
export function server(dsl) { | |
if (pretender) { | |
dsl.call(pretender); | |
return pretender; | |
} | |
pretender = new Pretender(dsl); | |
pretender.unhandledRequest = function (verb, path, request) { | |
fail("Pretender intercepted "+verb+" "+path+" but no handler was defined for this type of request"); | |
throw new Error("Pretender intercepted "+verb+" "+path+" but no handler was defined for this type of request"); |
View broccoli-tee-tree.js
var rimraf = require('rimraf'); | |
var helpers = require('broccoli-kitchen-sink-helpers'); | |
function TeeTree(inputTree, otherDir) { | |
this.inputTree = inputTree; | |
this.otherDir = otherDir; | |
} | |
TeeTree.prototype.read = function (readTree) { | |
var otherDir = this.otherDir; |
View gist:447557b3235da375e1b6
#define WEAKIFY(x) __weak typeof(x)weak_##x = x | |
#define STRONGIFY(x) __strong typeof(weak_##x)x = weak_##x | |
MyViewController * __block myController = [[MyViewController alloc] init…]; | |
// ... | |
WEAKIFY(myController); | |
myController.completionHandler = ^(NSInteger result) { | |
STRONGIFY(myController); | |
[myController dismissViewControllerAnimated:YES completion:nil]; | |
}; |
View nsusernotification.c
#include <stdio.h> | |
#include <CoreFoundation/CoreFoundation.h> | |
#include <objc/runtime.h> | |
#include <objc/message.h> | |
#include <ruby.h> | |
#include <ruby/encoding.h> | |
static CFStringRef bundle_identifier = CFSTR("com.apple.finder"); |
View github_org_admin.rb
#!/usr/bin/env ruby | |
require 'io/console' | |
require 'net/https' | |
require 'json' | |
require 'yaml' | |
require 'set' | |
script_name = File.basename($0) | |
$config_file = File.join(Dir.home, ".#{script_name}rc") |
View client.js
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', 'http://localhost:3333/www.fnordware.com/superpng/pnggrad8rgb.jpg', true); | |
xhr.responseType = 'blob'; | |
xhr.onload = function(e) { | |
var reader = new FileReader(); | |
reader.onloadend = function() { | |
var img = document.createElement('img'); |
View watchman-reset.sh
#!/bin/sh | |
(for root in $(watchman watch-list | jq -r '.roots | .[]'); do watchman watch-del "$root" ; done) |
OlderNewer