View NSData+PIOAdditions.h
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
// | |
// NSData+PIOAdditions.h | |
// PonyExpress | |
// | |
// Created by Michael Lewis on 2/13/13. | |
// | |
// | |
#import <Foundation/Foundation.h> |
View nginx.conf
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
location / { | |
chunked_transfer_encoding off; | |
proxy_http_version 1.1; | |
proxy_pass http://localhost:9001; | |
proxy_buffering off; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header Host $host:9001; | |
proxy_set_header Connection "Upgrade"; | |
proxy_set_header Upgrade websocket; | |
} |
View colors.js
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
/* | |
* To try it: | |
* c = $c.sRGB8(23,58,32); | |
* c.Lab(); | |
* c.Lab().sRGB8(); | |
*/ | |
var $c = {}; | |
( | |
function () { |
View redis_hot_standby.py
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 redis | |
import time | |
from contextlib import contextmanager | |
class _LockFailedError(Exception): pass | |
import logging | |
logging.basicConfig(level=logging.INFO) | |
logger = logging.getLogger() | |
View memoizer.m
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 _MEMO(iVarName, block) ^{if (!iVarName) {iVarName = (block)();} return iVarName;} | |
- (UIButton *)eatCheeseButton; | |
{ | |
return _MEMO(eatCheeseButton, ^{ | |
return [[UIButton alloc] init]; | |
})(); | |
} |
View argbase.py
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 abc | |
import re | |
import argparse | |
class ArgBaseError(Exception): pass | |
def _inject_vals(name, bases, dict): | |
expected_args = {} |
View graceful_http_server.py
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
class MyHTTPServer(tornado.httpserver.HTTPServer): | |
_stopped = False | |
def _quit_if_ioloop_is_empty(self): | |
ioloop = tornado.ioloop.IOLoop.instance() | |
if len(ioloop._handlers) <= 1: | |
logger.info("Graceful shutdown complete. Exiting!") | |
exit(0) | |
else: | |
logger.info("Waiting for ioloop to be empty. has %d handlers left" % len(ioloop._handlers)) |
View BUILD.RxSwift
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
objc_library( | |
name = "RxSwift", | |
srcs = glob([ | |
"RxSwift/**/*.swift", | |
]), | |
clang_module_name = "RxSwift", | |
enable_modules = True, | |
visibility = ["//visibility:public"], | |
) |
View Storyboard_DI_Example.swift
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
/// Does something special that ViewController_A wants | |
struct Service_A { | |
func doSomething() { | |
} | |
} | |
/// Does something special that ViewController_B wants | |
struct Service_B { | |
func doSomething() { | |
} |
View chrome.crashreport
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
Process: Google Chrome [95295] | |
Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome | |
Identifier: com.google.Chrome | |
Version: 24.0.1297.0 (1297.0) | |
Code Type: X86 (Native) | |
Parent Process: launchd [128] | |
User ID: 501 | |
Date/Time: 2012-10-22 20:55:37.493 -0700 | |
OS Version: Mac OS X 10.8.2 (12C54) |
NewerOlder