Skip to content

Instantly share code, notes, and snippets.

@reem
reem / yarn-error.log
Created November 9, 2016 02:19
yarn crash log
Arguments:
/usr/local/bin/node /usr/local/bin/yarn
PATH:
/Users/reem/.rbenv/shims:/Users/reem/google-cloud-sdk/bin:/usr/local/opt/ccache/libexec:/usr/local/bin:/usr/local/sbin:/Users/reem/.cargo/bin:/Users/reem/Library/Haskell/bin:/Users/reem/.cabal/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Users/reem/code/go/bin:/usr/local/m-cli:/usr/local/opt/fzf/bin
Yarn version:
0.16.1
Node version:
function runSaga(saga, ...args) {
const generator = saga(...args);
return execute(generator, []);
}
function* values(arr) {
for (let i = 0; i < arr.length; i++) {
yield arr[i];
}
}
@reem
reem / saga.js
Created October 28, 2016 08:45
function runSaga(saga, ...args) {
const generator = saga(...args);
return execute(generator, []);
}
function* values(arr) {
for (let i = 0; i < arr.length; i++) {
yield arr[i];
}
}
@reem
reem / lib.rs
Last active April 18, 2016 08:42
Fast atomic typed arena in rust.
//! # sync-arena
use std::mem;
use std::marker::PhantomData;
use std::sync::atomic::{AtomicUsize, Ordering};
pub struct TypedArena<T> {
root: AtomicUsize,
phantom: PhantomData<Option<InnerArena<T>>>
}
extern crate scoped_pool;
extern crate itertools;
extern crate rand;
use rand::Rng;
use scoped_pool::{Pool, Scope};
pub fn quicksort<T: Send + Sync + Ord>(pool: &Pool, data: &mut [T]) {
pool.scoped(move |scoped| do_quicksort(scoped, data))
@reem
reem / Cloudlabs Contributor Agreement.md
Last active March 3, 2016 22:43
Cloudlabs Contributor Agreement

CloudLabs Contributor Agreement

This CloudLabs Contributor Agreement (“CCA”) applies to any contribution that you make to any product or project managed by us (the “project”), and sets out the intellectual property rights you grant to us in the contributed materials. The term “us” shall mean CloudLabs, Inc (dba in California as TerminalCloud, Inc), which owns and operates Terminal.com. The term “you” shall mean the person or entity identified below. If you agree to be bound by these terms, fill in the information requested below and sign the CCA where indicated below. Read this agreement carefully before signing. These terms and conditions constitute a binding legal agreement.

  1. The term 'contribution' or ‘contributed materials’ means any source code, object code, patch, tool, sample, graphic, specification, manual, documentation, or any other material posted or submitted by you to the project.

  2. With respect to any worldwide copyrights, or copyright applications and registrations, in your contribution:

@reem
reem / Cargo.toml
Created February 25, 2016 00:19
Reproduction for rust-lang/rfcs#1409
[package]
name = "repro"
version = "0.1.0"
authors = ["Jonathan Reem <[email protected]>"]
[dependencies]
scoped-pool = "*"
scopeguard = "*"
@reem
reem / -
Created February 21, 2016 22:56
### Keybase proof
I hereby claim:
* I am reem on github.
* I am jonreem (https://keybase.io/jonreem) on keybase.
* I have a public key ASCxnui1FftjaawpeecMpry9NCovzmqOGw4-CCtUaQ3zrAo
To claim this, I am signing this object:
@reem
reem / all.js
Created November 25, 2015 23:06 — forked from anonymous/all.js
function all(promises) {
return promises.reduce(function (previous, next) {
return join(previous, next, function ([previous_results, next_val]) {
previous_results.push(next_val);
return previous_results;
});
}, Promise.resolve([]));
}
function join(x, y) {
use postgres::error::{SqlState, Error};
match query() {
Ok(rows) => { .. },
Err(Error::DbError(ref db)) if db.code() == SqlState::UniqueViolation {
},
Err(other) => { }
}