Skip to content

Instantly share code, notes, and snippets.

Torste Aikio zokier

Block or report user

Report or block zokier

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am zokier on github.
  • I am zokier (https://keybase.io/zokier) on keybase.
  • I have a public key ASBYCiXERvk4W2FAGPyfSSbGjWftTEoV8a7F101zJw_StQo

To claim this, I am signing this object:

View api_doc_generators
https://github.com/lord/slate
https://apiblueprint.org/
http://swagger.io/
http://raml.org/
View 2048.py
import os
import tty
tty.setcbreak(0)
M = [''] * 16
def G(v):
p = [''] * 4
u = list(filter(str, v))
i = 3
View rust-buildbox Dockerfile
ubuntu@ip-10-74-149-134:~$ mkdir rust-buildbox
ubuntu@ip-10-74-149-134:~$ cd rust-buildbox/
ubuntu@ip-10-74-149-134:~/rust-buildbox$ vim Dockerfile
ubuntu@ip-10-74-149-134:~/rust-buildbox$ docker build -t rust-buildbox .
ubuntu@ip-10-74-149-134:~/rust-buildbox$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
rust-buildbox latest be231641cce2 18 seconds ago 1.277 GB
ubuntu 14.04 c4ff7513909d 11 days ago 213 MB
ubuntu@ip-10-74-149-134:~/rust-buildbox$ docker run -t -i rust-buildbox /bin/bash
root@45ac8578f983:/# cd /home/rust/
@zokier
zokier / bitmatch.rs
Created Aug 11, 2014
Rust bitlevel pattern matching
View bitmatch.rs
#![feature(plugin_registrar)]
extern crate syntax;
extern crate rustc;
use syntax::ast;
use syntax::codemap::Span;
use syntax::ext::base;
use syntax::ext::base::{ExtCtxt, MacExpr};
use syntax::ext::build::AstBuilder;
use syntax::parse::token;
View subgraphs.dot
strict graph {
subgraph "South America" {
CL -- BR;
CL -- PE;
CO -- CL;
CO -- BR;
CO -- VE;
CO -- PE;
CO -- EC;
BR -- PE;
View gist:9451923
$ cargo-lite install --git https://github.com/bjz/cgmath-rs.git
note: Inferred pkgname cgmath-rs from path https://github.com/bjz/cgmath-rs.git
Traceback (most recent call last):
File "/tmp/cargo-lite/bin/cargo-lite", line 587, in <module>
main(opts)
File "/tmp/cargo-lite/bin/cargo-lite", line 573, in main
pkg.install(args=rustcargs)
File "/tmp/cargo-lite/bin/cargo-lite", line 497, in install
force=force)
File "/tmp/cargo-lite/bin/cargo-lite", line 289, in install
View impossible_circuit.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View test_aes.rs
extern mod openssl = "openssl";
extern mod extra;
use crypto = openssl::crypto::symm;
use extra::hex::FromHex;
#[test]
fn test_aes_zeroes_key() {
let key = "00000000000000000000000000000000".from_hex().unwrap();
let plaintext = "80000000000000000000000000000000".from_hex().unwrap();
let ciphertext = "3ad78e726c1ec02b7ebfe92b23d9ec34".from_hex().unwrap();
View deref_iter.rs
fn is_printable_ascii(c: u8) -> bool {
c >= 0x20u8 && c < 0x7fu8
}
fn main() {
// why temporary variable needed?
// error: borrowed value does not live long enough
let test_data: ~[u8] = std::io::File::open(&Path::new("test_data")).read_to_end();
let _test_data_filtered: ~[u8] = test_data.iter()
// why double deref?
You can’t perform that action at this time.