“It would have taken twice as long to build it properly” - http://developerexcuses.com
This file contains hidden or 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 Foundation; | |
int main(int argc, const char * argv[]) | |
{ | |
__block BOOL keepRunning = YES; | |
// Configure a dispatch source to listen for SIGTERM | |
// Adapted from https://mikeash.com/pyblog/friday-qa-2011-04-01-signal-handling.html | |
dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGTERM, 0, dispatch_get_main_queue()); | |
dispatch_source_set_event_handler(source, ^{ |
This file contains hidden or 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
private class LRUCacheNode<Key: Hashable, Value> { | |
let key: Key | |
var value: Value | |
var previous: LRUCacheNode? | |
var next: LRUCacheNode? | |
init(key: Key, value: Value) { | |
self.key = key | |
self.value = value | |
} |
This file contains hidden or 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
require 'uri' | |
require 'net/http' | |
require 'json' | |
require 'ostruct' | |
module Heroku | |
module Addons | |
class Addon | |
attr_accessor :name |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
Be There: When people need you, they need all of you. Setting aside distractions and judgments to be mentally and emotionally present is a sign of respect. It improves communication and strengthens relationships. |
This file contains hidden or 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
CREATE TABLE cfurl_cache_blob_data( | |
entry_ID INTEGER PRIMARY KEY, | |
response_object BLOB, | |
request_object BLOB, | |
proto_props BLOB, | |
user_info BLOB | |
); | |
CREATE INDEX proto_props_index ON cfurl_cache_blob_data(entry_ID); | |
CREATE TABLE cfurl_cache_receiver_data( |
This file contains hidden or 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
// Courtesy of http://stackoverflow.com/a/12254356/1069919 | |
// NSLocale and CFLocale are toll-free bridged, so if you have an existing | |
// NSNumberFormatter, you can get its locale and use that instead. | |
CFLocaleRef usLocale = CFLocaleCreate(NULL, CFSTR("en_US")); | |
CFNumberFormatterRef usFormatter = CFNumberFormatterCreate(NULL, usLocale, kCFNumberFormatterCurrencyStyle); | |
CFLocaleRef frLocale = CFLocaleCreate(NULL, CFSTR("fr_FR")); | |
CFNumberFormatterRef frFormatter = CFNumberFormatterCreate(NULL, frLocale, kCFNumberFormatterCurrencyStyle); | |
NSString * usString = (__bridge NSString *)CFNumberFormatterGetFormat(usFormatter); | |
NSString * frString = (__bridge NSString *)CFNumberFormatterGetFormat(frFormatter); |
This file contains hidden or 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/bash | |
if rvm --version 2>/dev/null; then | |
gem install soloist | |
else | |
sudo gem install soloist --no-ri --no-rdoc | |
fi | |
mkdir -p ~/cookbooks; cd ~/cookbooks |
This file contains hidden or 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
# Helper method to fix Apple's stupid png optimizations | |
# Adapted from: | |
# http://www.axelbrz.com.ar/?mod=iphone-png-images-normalizer | |
# https://github.com/peperzaken/iPhone-optimized-PNG-reverse-script/blob/master/Peperzaken/Ios/DecodeImage.php | |
# PNG spec: http://www.libpng.org/pub/png/spec/1.2/PNG-Contents.html | |
require 'zlib' | |
require 'logger' | |
module PNG |