View resolveWithTimeout.swift
1 2 3 4 5 6 7 8 9 10
extension NSNetService {
func resolveWithTimeout(timeout: NSTimeInterval, success: () -> ()) {
class NetServiceDelegate: NSObject, NSNetServiceDelegate {
let oldDelegate: NSNetServiceDelegate?
let netService: NSNetService
let success: () -> ()
var holdSelf: NetServiceDelegate?
init(netService: NSNetService, success: () -> ()) {
self.oldDelegate = netService.delegate
View covered.html
1 2 3 4 5 6 7 8 9 10
<!DOCTYPE html>
<style>
html {
font: 18px "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.covered {
position: relative;
overflow: hidden;
View curried.js
1 2 3 4 5 6 7 8 9 10
function curried(fn) {
function curry() {
if (arguments.length >= fn.length) {
return fn.apply(this, arguments);
}
var args = arguments;
return function() {
return curry.apply(
null, Array.prototype.concat.apply(
Array.prototype.slice.call(args), arguments)
View showAlert.swift
1 2 3 4 5 6 7 8 9 10
import UIKit
 
// Notes:
// - You must explicitly weak link to UIKit to support iOS 7
// - Action sheets on iOS 7 only show a title
 
func showAlert(viewController: UIViewController, style: UIAlertControllerStyle = .Alert, title: String? = nil, message: String? = nil, sourceView: UIView? = nil, completion: (() -> ())? = nil, buttons: (UIAlertActionStyle, String, (() -> ())?)...) {
if (NSClassFromString("UIAlertController") != nil) {
// iOS 8+
View keybase.md

Keybase proof

I hereby claim:

  • I am Sidnicious on github.
  • I am sidney (https://keybase.io/sidney) on keybase.
  • I have the public key with fingerprint 5E68 5E60 EB87 3365 4DCB  0057 0DAA 1A4A B1D8 8291

To claim this, I am signing this object:

View Makefile
1 2 3 4 5 6 7 8 9 10
EVERYTHING = $(patsubst %.c,%,$(wildcard *.c))
 
CC=clang
CCFLAGS +=\
-std=c99\
-DDEBUG\
-g\
-Wall\
-Wpedantic\
-Werror
View pushbundler.py
1 2 3 4 5 6 7 8 9 10
import json, subprocess, hashlib
from zipfile import ZipFile
 
class PushPackage(object):
 
def __init__(self, filename):
self.zfile = ZipFile(filename, 'w')
self.manifest = {}
 
def __enter__(self):
View map.cpp
1 2 3 4 5 6 7 8 9 10
#include <team-functional.hpp>
#include <iostream>
 
using namespace std;
using namespace team;
 
int slowSquare(int a) {
usleep(100 * (5 - a));
return a * a;
}
View bahn_server.cpp
1 2 3 4 5 6 7 8 9
#include <team/bahn.h>
 
const char *ip = "127.0.0.1";
const int port = 8080;
 
using namespace std;
using namespace team;
 
int main() {
Something went wrong with that request. Please try again.