Skip to content

Instantly share code, notes, and snippets.

@pmsanford
pmsanford / keybase.md
Created February 6, 2018 22:28
keybase.md

Keybase proof

I hereby claim:

  • I am pmsanford on github.
  • I am psanford (https://keybase.io/psanford) on keybase.
  • I have a public key ASAuDe2Q63VeThlyB1Ww7kNzQuneOlRBJhuGDaG__3gcVQo

To claim this, I am signing this object:

@pmsanford
pmsanford / gist:392c694e1bc98533b2cf
Last active August 29, 2015 14:24
TDL broken wheel
~/dev/temp $ cp ~/Downloads/tdl-1.4.0-py3-none-any
tdl-1.4.0-py3-none-any (1).whl tdl-1.4.0-py3-none-any.whl
~/dev/temp $ cp ~/Downloads/tdl-1.4.0-py3-none-any.whl ./
~/dev/temp $ cp ~/Dropbox/tdl-1.4.0-py3-fixed-none-any.whl ./
~/dev/temp $ virtualenv --python=python3 venv
Running virtualenv with interpreter /usr/local/bin/python3
Using base prefix '/usr/local/Cellar/python3/3.4.3_1/Frameworks/Python.framework/Versions/3.4'
New python executable in venv/bin/python3.4
Also creating executable in venv/bin/python
Installing setuptools, pip...done.
use std::iter::repeat;
fn main() {
let vec: Vec<_> = repeat("a").take(50).collect();
let string: String = repeat("b").take(50).collect();
println!("{}", vec);
println!("{}", string);
}
use std::thread::{Thread, JoinGuard};
use std::io::stdio::set_stderr;
use std::io::util::NullWriter;
fn main() {
let _tg: JoinGuard<()> = Thread::spawn(move || {
set_stderr(box NullWriter);
panic!("Test");
});
println!("Done");
}
[package]
name = "temptest"
version = "0.0.1"
authors = ["Paul Sanford <me@paulsanford.net>"]
[lib]
name = "templib"
src = "src/lib.rs"
extern crate serialize;
use serialize::json;
use std::os;
use std::io::fs::File;
fn main() {
let args: Vec<String> = os::args();
let mut r = &mut File::open(&Path::new(args[1].as_slice()));
fn accepts_optional_fn_ptr(_test: Option<fn(int) -> int>) {}
fn test_int(_: int) -> int { 0i }
fn main() {
accepts_optional_fn_ptr(Some(test_int));
}
extern crate syntax;
extern crate rustc;
use syntax::diagnostic::SpanHandler;
use syntax::codemap::Span;
use syntax::ast::{Item, Item_};
struct StructPkg {
pub name: String,
pub def: Item,
pub impls: Vec<Item>
@pmsanford
pmsanford / makefile-osx
Created December 18, 2014 19:48
OSX libtcod makefile
# libtcod makefile
# to build debug version, run "make -f makefile-linux debug"
# to build release version, run "make -f makefile-linux release"
SRCDIR=src
INCDIR=include
#dependencies
# SDL
SDL_FLAGS=`sdl-config --cflags`
SDL_LIBS=`sdl-config --libs`
~/dev $ mkdir sandbox
~/dev $ cd sandbox
~/dev/sandbox $ virtualenv --python=python3 venv
Running virtualenv with interpreter /usr/local/bin/python3
Using base prefix '/usr/local/Cellar/python3/3.4.0_1/Frameworks/Python.framework/Versions/3.4'
New python executable in venv/bin/python3.4
Also creating executable in venv/bin/python
Installing setuptools, pip...done.
~/dev/sandbox $ source venv/bin/activate
(venv)~/dev/sandbox $ pip install pandas