Skip to content

Instantly share code, notes, and snippets.

View FreeMasen's full-sized avatar

Robert Masen FreeMasen

View GitHub Profile
<svg viewBox="0 0 50 50">
<defs>
<mask id="mask">
<circle
r="24"
cy="25"
cx="25"
fill="white"
/>
Checking rand v0.6.5
Checking failure v0.1.5
Checking target-lexicon v0.3.0
error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
--> /Users/rfm/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/std.rs:55:6
|
55 | impl SeedableRng for StdRng {
| ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
error[E0277]: the trait bound `rand_isaac::IsaacRng: rand_core::SeedableRng` is not satisfied
@FreeMasen
FreeMasen / thing.js
Created February 21, 2019 05:37
Enum Pattern Matching
export function Thing {
constructor(one, two) {
this.one = one;
this.two = two;
}
}
let t1 = new Thing(1, 2);
let t2 = new Thing('one', 'two');
let t3 = addThings(t1, t2); // {one: '1 & one', two: '2 & two'}
@FreeMasen
FreeMasen / brew.log
Created January 25, 2019 15:46
brew install libiconv
libiconv is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have libiconv first in your PATH run:
echo 'export PATH="/usr/local/opt/libiconv/bin:$PATH"' >> ~/.bash_profile
For compilers to find libiconv you may need to set:
export LDFLAGS="-L/usr/local/opt/libiconv/lib"
export CPPFLAGS="-I/usr/local/opt/libiconv/include"
@FreeMasen
FreeMasen / crates.io.failure.log
Created January 25, 2019 14:33
crates.io build failure
Marcus:crates.io rfm$ cargo clean && cargo test
Compiling version_check v0.1.4
Compiling winapi-build v0.1.1
Compiling libc v0.2.42
Compiling nodrop v0.1.12
Compiling num-traits v0.1.40
Compiling unicode-xid v0.1.0
Compiling siphasher v0.2.2
Compiling scopeguard v0.3.3
Compiling lazy_static v1.0.0
#[macro_use]
extern crate nom;
type Duration = Vec<(f32, DurationUnit)>;
pub fn parse(s: &str) -> Result<Duration, String> {
match parse_duration(s) {
Ok(pair) => {
Ok(pair.1)
},
Err(e) => Err(format!("Error parsing duration {:?}", e)),
}
INFO 2018-09-25T19:54:22Z: analytics: Starting up
INFO 2018-09-25T19:54:22Z: warp::server: warp drive engaged: listening on 127.0.0.1:5555
INFO 2018-09-25T19:54:33Z: warp::filters::log: "POST /analytics/landing HTTP/1.1" 400 720.83
@FreeMasen
FreeMasen / Cargo.toml
Last active September 25, 2018 05:04
getpid
[package]
name = "getpid"
version = "0.1.0"
[dependencies]
walkdir = "1"
docopt = "2"
enum Expression {
Binary(BinaryExpression),
Unary(Box<UnaryExpression>),
}
struct BinaryExpression {
left: Box<Expression>,
operator: Operator,
right: Box:<Expression>,
}
let wasm;
fetch('/rust_program_name.wasm')
.then(res => res.arrayBuffer())
.then(buf => {
return WebAssembly.Instantiate(buf, importObject)
.then(mod => {
wasm = mod.instance.exports;
start();
});
});