Skip to content

Instantly share code, notes, and snippets.

View dckc's full-sized avatar

Dan Connolly dckc

View GitHub Profile
@dckc
dckc / footpedal_vp.purs
Last active August 29, 2015 13:59
purescript struggles
module Main where
import Control.Monad.Eff
import Data.Array
import Debug.Trace
main = trace "Hello, World!"
service dev endpoint = do
@dckc
dckc / money.mt
Last active August 29, 2015 14:01
# cf. http://www.erights.org/elib/capability/ode/ode-capabilities.html
def makeBrandPair := import("sealing")
def __makeOrderedSpace := import("regions") # for 0..balance
def makeMint(name):
def [sealer, unsealer] := makeBrandPair(name)
object mint:
@dckc
dckc / gist:5c0df274b11c72383f76
Created July 9, 2014 14:58
cabal install xlsx failure on Mac OS X
bash-3.2$ cabal install xlsx
Resolving dependencies...
Downloading binary-0.7.2.1...
Configuring binary-0.7.2.1...
Building binary-0.7.2.1...
Preprocessing library binary-0.7.2.1...
[1 of 9] Compiling Data.Binary.Builder.Base ( src/Data/Binary/Builder/Base.hs, dist/build/Data/Binary/Builder/Base.o )
[2 of 9] Compiling Data.Binary.Builder.Internal ( src/Data/Binary/Builder/Internal.hs, dist/build/Data/Binary/Builder/Internal.o )
[3 of 9] Compiling Data.Binary.Get.Internal ( src/Data/Binary/Get/Internal.hs, dist/build/Data/Binary/Get/Internal.o )
[4 of 9] Compiling Data.Binary.Builder ( src/Data/Binary/Builder.hs, dist/build/Data/Binary/Builder.o )
@dckc
dckc / lib.rs
Created August 2, 2014 17:36
problem printing rserve server attributes
#![crate_name = "rserve"]
#![crate_type = "lib"]
#![feature(phase)]
#[phase(plugin, link)] extern crate log;
//extern crate debug;
use std::io::net::ip::Port;
use std::io::{IoResult, IoError, InvalidInput};
use std::iter::range_inclusive;
@dckc
dckc / lib.rs
Created August 2, 2014 19:51
closure lifetime issues
pub fn decode_id_string(buf: &[u8]) -> IoResult<ServerProtocol> {
debug!("decode_id_string(buf={})", buf);
if buf.len() != 32 {
return Err(IoError{ kind: InvalidInput, desc: "id string length must be 32", detail: None});
}
let pick_attr = |i: uint| {
let offset = i * 4;
@dckc
dckc / BS vs RK.ipynb
Last active August 29, 2015 14:04
BS vs RK
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dckc
dckc / no-b-works
Created September 2, 2014 19:15
local-install-puzzle
(he2418)dconnolly@bid-bse02:~/projects/heron_extract$ mkdir dl
(he2418)dconnolly@bid-bse02:~/projects/heron_extract$ pip install --allow-all-external --download dl -r requirements.txt
Downloading/unpacking https://bitbucket.org/DanC/blackknightcap/get/284d87390a26.zip (from -r requirements.txt (line 15))
Using download cache from /home/dconnolly/.local/cache/pip-download-cache/https%3A%2F%2Fbitbucket.org%2FDanC%2Fblackknightcap%2Fget%2F284d87390a26.zip
Saved ./dl/284d87390a26.zip
Running setup.py (path:/tmp/pip-8yQPIF-build/setup.py) egg_info for package from https://bitbucket.org/DanC/blackknightcap/get/284d87390a26.zip
Downloading/unpacking https://github.com/dckc/pyCap/archive/master.zip (from -r requirements.txt (line 29))
Using download cache from /home/dconnolly/.local/cache/pip-download-cache/https%3A%2F%2Fgithub.com%2Fdckc%2FpyCap%2Farchive%2Fmaster.zip
Saved ./dl/master.zip
@dckc
dckc / prelude.mt
Created September 6, 2014 19:36
how's this for simple__quasiParser?
object simple__quasiParser:
object VALUE_HOLE: pass
object PATTERN_HOLE: pass
def valueHole(i):
(VALUE_HOLE, i)
def valueMaker(chunks):
object x:
@dckc
dckc / openssl
Last active August 29, 2015 14:06
pip SSL woes
> openssl s_client -connect pypi.python.org:443
CONNECTED(00000003)
depth=1 /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
0 s:/2.5.4.15=Private Organization/1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Delaware/serialNumber=3359300/streetAddress=16 Allen Rd/postalCode=03894-4801/C=US/ST=NH/L=Wolfeboro,/O=Python Software Foundation/CN=www.python.org
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA
1 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA
@dckc
dckc / movie-rec.ipynb
Created December 6, 2014 23:25
movie rec
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.