Skip to content

Instantly share code, notes, and snippets.

View azinman's full-sized avatar

Aaron Zinman azinman

  • San Francisco
View GitHub Profile
@azinman
azinman / ClientBenchmark.scala
Created January 14, 2011 07:07
Testing 50k+ concurrent connections using netty
package com.mypackage.benchmark
import com.mypackage.util.Logging
import net.lag.configgy.Configgy
import scala.collection.mutable
import scala.collection.JavaConversions._
import java.net.InetSocketAddress
import java.nio.charset.Charset
import java.util.concurrent._
@azinman
azinman / animation.js
Created June 3, 2011 05:38
Apply CSS transformations, remembering the past history. Useful for undoable animations/transitions.
// Undo-able CSS transformations on DOM objects
// Requires jQuery
// MIT Licensed
// Author: Aaron Zinman <[email protected]>
// Part of Defuse: http://defuse.media.mit.edu
// Tested in Safari, soon testing in: Chrome and Firefox
if (window.defuse == null) defuse = {animation:{}};
/**
* Applies a series of CSS transformation (contained in the cssObj dictionary)
@azinman
azinman / floatDoubleTest.m
Created February 22, 2012 01:17
Comparison of float and double pre-defined values in iOS/LLVM
//
// main.m
// quicky
//
// Created by Aaron Zinman on 2/21/12.
// Copyright (c) 2012 Empirical Design LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
@azinman
azinman / gist:6479896
Created September 7, 2013 22:19
Convert a unix epoch into something human readable
$ date -d @1378585039
Sat Sep 7 20:17:19 UTC 2013
### Keybase proof
I hereby claim:
* I am azinman on github.
* I am azinman (https://keybase.io/azinman) on keybase.
* I have a public key whose fingerprint is 648F C16E 7315 35E6 48FE C55A FA5C 5707 A23C 3CC7
To claim this, I am signing this object:
@azinman
azinman / AppDelegate.m
Last active February 20, 2018 06:53
@synchronized vs pthread mutex vs NSRecursiveLock vs Semaphore
//
// AppDelegate.m
// LockTest
//
// Created by zinman on 1/29/16.
//
#import "AppDelegate.h"
#import <pthread.h>
@azinman
azinman / jail.sb
Created February 25, 2016 02:56
Example jail for vanadium jenkins tests
(version 1)
(deny default)
(allow network*)
(allow file-write* file-read-data file-read-metadata
(regex "^/Users/zinman/vanadium")
(regex "^(/private)?/tmp"))
(allow file-read-data file-read-metadata
(regex "^/dev/autofs.*")
@azinman
azinman / reflectionLimitations.swift
Created February 25, 2016 03:06
swift limitations for reflection
enum X : Int {
case Foo = 2
case Bar = 8
case Baz = 4
}
// Can also do this with no difference
// enum X {
// case Foo
// case Bar
@azinman
azinman / NamingPackage.swift
Created March 25, 2016 01:56
autogenerated swift files from VDL
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// This file was auto-generated by the vanadium vdl tool.
// Source: v.io/v23/naming
public enum Naming {
/* The following constants originate in file: types.vdl */
@azinman
azinman / JsonCastingAnnoyances.swift
Last active April 25, 2016 19:37
Some non-obvious behavior casting values
var outputTarget = 8
// AnyObject forces the Swift Int to become an NSNumber. NSNumbers can cast
// to various primitive types even if the original value is not of the same
// type. For example, ints can be cast to bool (objective-c bools are
// actually 8-bit chars), and the bool is true if the value is non-zero (can
// be 8, -100, etc).
func get(key: String) -> AnyObject? {
return outputTarget
}