Skip to content

Instantly share code, notes, and snippets.

View killerswan's full-sized avatar

Kevin Cantú killerswan

View GitHub Profile
@killerswan
killerswan / gist:3109634
Created July 14, 2012 06:03
better printing
sed -e 's/x/▮/' -e 's/\\\\/λ/'
@killerswan
killerswan / gist:3078032
Created July 9, 2012 18:23
slides with pandoc
# where ./slidy/slidy.css exists (and also ./foo.png)
pandoc --data-dir=. --self-contained -s -t slidy -o demo.html demo.md
@killerswan
killerswan / gist:3068252
Created July 7, 2012 22:04
cargo install is broken?
kunix:temp $
kunix:temp $ cargo init
info: initialized .cargo in /home/kevin/.cargo
kunix:temp $
kunix:temp $ cargo install rparse
info: syncing source: central...
info: synced source: central
info: installing central/rparse via git...
kunix:temp $
kunix:temp $ ls ./.cargo/bin
@killerswan
killerswan / gist:3064838
Created July 7, 2012 05:08
unhelpful in gdb, too
(gdb) target exec ./shootout-chameneos-redux
...
(gdb) break upcall_fail
Breakpoint 1 at 0x7ffff71d44f0: file /code/rust/src/rt/rust_upcall.cpp, line 95.
(gdb) run 50
Starting program: /code/chameneos/shootout-chameneos-redux 50
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff7ff7700 (LWP 20173)]
[New Thread 0x7ffff7fd3700 (LWP 20174)]
@killerswan
killerswan / gist:3064760
Created July 7, 2012 04:51
unhelpful debug messages on a crash
$ rustc shootout-chameneos-redux.rs
shootout-chameneos-redux.rs:225:11: 225:26 warning: value assigned to `second_creature` is never read
shootout-chameneos-redux.rs:225 let mut second_creature = { name: 0, color: Red }; // of initializing to junk?
^~~~~~~~~~~~~~~
$
$
$ RUST_LOG=shootout-chameneos-redux ./shootout-chameneos-redux 50
blue + blue -> blue
blue + red -> yellow
blue + yellow -> red
@killerswan
killerswan / gist:2879750
Created June 6, 2012 03:43
servo build fails on harfbuzz
$ git submodule init && git submodule update && ./autogen.sh
Submodule 'src/harfbuzz' (git://github.com/brson/harfbuzz-servo.git) registered for path 'src/harfbuzz'
Submodule 'src/mozjs' (git://github.com/brson/mozjs.git) registered for path 'src/mozjs'
Submodule 'src/ragel' (git://github.com/brson/ragel-dist.git) registered for path 'src/ragel'
Submodule 'src/rust-azure' (git://github.com/brson/rust-azure.git) registered for path 'src/rust-azure'
Submodule 'src/rust-cocoa' (git://github.com/pcwalton/rust-cocoa.git) registered for path 'src/rust-cocoa'
Submodule 'src/rust-harfbuzz' (git://github.com/brson/rust-harfbuzz.git) registered for path 'src/rust-harfbuzz'
Submodule 'src/rust-mozjs' (git://github.com/brson/rust-mozjs.git) registered for path 'src/rust-mozjs'
Submodule 'src/rust-sdl' (git://github.com/brson/rust-sdl.git) registered for path 'src/rust-sdl'
Submodule 'src/rust-stb-image' (git://github.com/pcwalton/rust-stb-image.git) registered for path 'src/rust-stb-image'
type demo<G: copy> = G;
iface demo_iface<U: copy> {
fn show(U);
fn run(fn(U), U);
}
mod demo {
export demo_impl;
impl demo_impl<K: copy> of demo_iface<K> for demo<K> {
$ make RUST_LOG=rustc=0,::rt::backtrace
cfg: shell host triple x86_64-unknown-linux-gnu
cfg: host for x86_64-unknown-linux-gnu is x86_64
cfg: unix-y environment
cfg: using gcc
cfg: no llnextgen found, omitting grammar-verification
compile_and_link: x86_64-unknown-linux-gnu/stage0/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd.so
/code/rust/src/libstd/map.rs:202:12: 202:29 warning: unused variable: `x`
/code/rust/src/libstd/map.rs:202 fn xx(x:V) { () };
^~~~~~~~~~~~~~~~~
$ make RUST_LOG=rustc=0,::rt::backtrace
cfg: shell host triple x86_64-unknown-linux-gnu
cfg: host for x86_64-unknown-linux-gnu is x86_64
cfg: unix-y environment
cfg: using gcc
cfg: no llnextgen found, omitting grammar-verification
compile_and_link: x86_64-unknown-linux-gnu/stage0/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd.so
/code/rust/src/libstd/test.rs:330:7: 330:43 warning: unknown warning: 'non_implicitly_copyable_typarams'
/code/rust/src/libstd/test.rs:330 #[warn(no_non_implicitly_copyable_typarams)]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ make check
cfg: shell host triple x86_64-unknown-linux-gnu
cfg: host for x86_64-unknown-linux-gnu is x86_64
cfg: unix-y environment
cfg: using gcc
cfg: no llnextgen found, omitting grammar-verification
cfg: including dist rules
cfg: including test rules
cfg: reconfiguring
configure: looking for configure programs