Skip to content

Instantly share code, notes, and snippets.

Avatar

Dan Connolly dckc

View GitHub Profile
@dckc
dckc / footpedal_vp.purs
Last active Aug 29, 2015
purescript struggles
View footpedal_vp.purs
module Main where
import Control.Monad.Eff
import Data.Array
import Debug.Trace
main = trace "Hello, World!"
service dev endpoint = do
View money.mt
# 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 Jul 9, 2014
cabal install xlsx failure on Mac OS X
View gist:5c0df274b11c72383f76
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 Aug 2, 2014
problem printing rserve server attributes
View lib.rs
#![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 Aug 2, 2014
closure lifetime issues
View lib.rs
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;
View BS vs RK.ipynb
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 Sep 2, 2014
local-install-puzzle
View no-b-works
(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 Sep 6, 2014
how's this for simple__quasiParser?
View prelude.mt
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 Aug 29, 2015
pip SSL woes
View openssl
> 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
View movie-rec.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.