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
#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]; | |
}; |
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
#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"); |
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
#!/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") |
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
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'); |
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
#!/bin/sh | |
(for root in $(watchman watch-list | jq -r '.roots | .[]'); do watchman watch-del "$root" ; done) |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |