Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Lewis mikelikespie

View GitHub Profile
@mikelikespie
mikelikespie / BUILD.RxSwift
Created October 4, 2016 20:30
RxSwift buiild file
View BUILD.RxSwift
objc_library(
name = "RxSwift",
srcs = glob([
"RxSwift/**/*.swift",
]),
clang_module_name = "RxSwift",
enable_modules = True,
visibility = ["//visibility:public"],
)
View Storyboard_DI_Example.swift
/// Does something special that ViewController_A wants
struct Service_A {
func doSomething() {
}
}
/// Does something special that ViewController_B wants
struct Service_B {
func doSomething() {
}
@mikelikespie
mikelikespie / fun.swift
Last active August 29, 2015 14:26
infinite hang in swift
View fun.swift
public class Promise<T> {
}
/// These are basically promises that won't terminate until they hit the end
public enum MoreOrEnd<T> {
public typealias ValueTuple = (T, Promise<MoreOrEnd<T>>)
case More(ValueTuple)
case End
}
@mikelikespie
mikelikespie / uio_test.go
Last active August 29, 2015 13:59
Read does not return when FD is closed for UIO
View uio_test.go
package foo
import (
"io"
"os"
"testing"
"time"
)
func TestReadClosed(t *testing.T) {
@mikelikespie
mikelikespie / NSData+PIOAdditions.h
Created February 14, 2013 06:35
Zero-Copy bridging between dispatch_data_t and NSData
View NSData+PIOAdditions.h
//
// NSData+PIOAdditions.h
// PonyExpress
//
// Created by Michael Lewis on 2/13/13.
//
//
#import <Foundation/Foundation.h>
@mikelikespie
mikelikespie / chrome.crashreport
Created October 23, 2012 03:55
Chrome Crashing
View chrome.crashreport
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)
@mikelikespie
mikelikespie / installation.sh
Created August 23, 2012 01:52
Launchctl for ipython notebook (and installation instructions)
View installation.sh
# how to set up the virtualenv used in this
# First move org.lolrus.ipython-notebook.plist to ~/Library/LaunchAgents
NOTEBOOK_DIR=${HOME}/notebook
brew install zmq
which virtualenv > /dev/null || sudo easy_install virtualenv # easiest to install virtualenv this way if you dont have it
@mikelikespie
mikelikespie / argbase.py
Created July 28, 2012 05:34
Interface for Argparse Similar to Declarative base
View argbase.py
import abc
import re
import argparse
class ArgBaseError(Exception): pass
def _inject_vals(name, bases, dict):
expected_args = {}
@mikelikespie
mikelikespie / versions.sql
Created February 14, 2012 21:01
Versioned items with rules
View versions.sql
drop schema if exists foo cascade;
create schema foo;
CREATE TABLE foo.object (
id uuid primary key,
version int4 not null
);
CREATE TABLE foo.items_base (
@mikelikespie
mikelikespie / gram.go
Created January 30, 2012 08:45
Gram.y converted to go without types & functions implemented yet... trying to see if I can get Postgres's parser running in go.
View gram.go
//line simplegram.y:2
package main
//line simplegram.y:6
type yySymType struct {
yys int
core_yystype core_YYSTYPE
/* these fields must match core_YYSTYPE: */
ival int
str string