Skip to content

Instantly share code, notes, and snippets.

Ben Batha bbatha

Block or report user

Report or block bbatha

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
bbatha / npm_debug.log
Last active Jun 1, 2017
npm5 large package debug log
View npm_debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\bbatha\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '@fds/fds-cdn-data',
1 verbose cli '-ddd' ]
2 info using npm@5.0.1
3 info using node@v8.0.0
4 silly install loadCurrentTree
5 silly install readLocalPackageData

Keybase proof

I hereby claim:

  • I am bbatha on github.
  • I am bbatha ( on keybase.
  • I have a public key ASBKD6z2ozTsC69HOpADwtuW09OlTDxf-jyJs2oCG-IPiAo

To claim this, I am signing this object:

bbatha /
Created Oct 23, 2015 — forked from anonymous/
Shared via Rust Playground
struct Foo(u32);
fn foo(val: u32) -> Foo { Foo(val) }
impl Foo {
fn new() -> Self { Foo(3) }
trait BoolExt {
View Scoped pool lifetime problems
extern crate scoped_threadpool;
use scoped_threadpool::{Pool, Scope};
pub struct RefOwner<'a>(&'a str);
pub struct ScopeRef<'pool, 'scope> where 'pool: 'scope {
scope: &'scope Scope<'pool, 'scope>,
View pool problems
Compiling pool_problems v0.1.0 (file:///home/user/bbatha/experiments/pool_problems)
src/ 70:61 error: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements [E0495]
src/ let executor = Executor::new(auth_method, &scope);
src/ 73:11 note: first, the lifetime cannot outlive the method call at 69:8...
src/ pool.scoped(|scope| {
src/ let executor = Executor::new(auth_method, &scope);
src/ let result = executor.execute(&"true", &host).recv().unwrap();
src/ assert!(result.is_ok(), "Ensure you have a valid ssh-key pair for localhost");
src/ });
View Greatest Association
create_table(:minors) do
primary_key :id
create_table(:states) do
primary_key :id
foreign_key :minor_id, :minors
String :state, :size => 10
View gist:989d84c6e4aeca637e99
use std::collections::HashSet;
use std::hash::Hash;
use typed_arena::Arena;
pub enum Edges<'a, L: 'a, N: 'a + Hash> {
Leaves(Vec<&'a L>),
Children(Vec<&'a Node<'a, L, N>>)
use std::collections::HashSet;
use std::hash::Hash;
pub struct Dag<'a, L: 'a, N: 'a> {
leaves: HashSet<L>,
// Might be better as an arena but that isn't available the playpen
nodes: Vec<Node<'a, L, N>>
impl<'a, L: 'a + Eq + Hash, N: 'a> Dag<'a, L, N> {
View gist:8a1030c2d0f78be9eab1
[bbatha@dev threadpool-rs]% cargo test
Compiling threadpool v0.0.1 (file:///home/bbatha/projects/threadpool-rs)
src/ 42:16 error: `pool` does not live long enough
src/ pool.execute(move || {
src/ 47:6 note: reference must be valid for the block at 38:18...
src/ fn it_works() {
src/ let mut pool = ScopedThreadPool::new(2);
src/ for _ in (0..3) {
bbatha / gist:9df1fcc1fa0a72a9f57d
Created Apr 13, 2015
Arc::new() lifetime error
View gist:9df1fcc1fa0a72a9f57d
fn it_works() {
let guards: Vec<thread::JoinGuard<()>> = Vec::with_capacity(3);
let mut pool = ScopedThreadPool::new(2);
for _ in (0..3) {
guards.push(pool.execute(move || {
println!("Things are happening!");
You can’t perform that action at this time.