Skip to content

Instantly share code, notes, and snippets.

require 'logger'
require 'openssl'
require 'ruby-prof'
require 'byebug'
require 'signet/oauth_2/client'
require 'google/apis/bigquery_v2'
project_id = <project_id>
dataset_id = <big_query_data_set>
table = <big_query_table>
use crate::read_events::{HandlerFn, Message, read_events};
use circbuf::CircBuf;
use evalexpr::Value;
use failure::Error;
use maplit::hashmap;
use quiche;
use rmp_serde::Serializer;
use rand::{Rng, thread_rng};
use serde::Serialize;
use speculate::speculate;
@bittrance
bittrance / Cargo.toml
Created July 19, 2019 17:43
Working loop_fn retries example.
[package]
name = "rusoto_cwl_test"
version = "0.1.0"
authors = ["Bittrance <anders.qvist@burtcorp.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
futures = "0.1.25"
@bittrance
bittrance / run-1-errors
Created July 28, 2019 22:46
10000x cargo test -q -- tests::topology --skip topology_reload_healthchecks --skip topology_change_sink_no_gap
failures:
---- topology::tests::topology_remove_source_add_source_with_same_port stdout ----
thread 'topology::tests::topology_remove_source_add_source_with_same_port' panicked at 'assertion failed: `(left == right)`
left: `100`,
right: `0`', src/topology/mod.rs:892:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
1: std::sys_common::backtrace::_print
@bittrance
bittrance / readme.md
Last active January 15, 2020 21:21
README draft for phat - a JSON-centric HTTP streaming tool

phat - a JSON-centric HTTP request stream tool

Think curl, parallel an jq rolled into one tool.

Getting started

phat is an HTTP client:

$ phat https://ze.api/users
[{"user": "bittrance"}, {"user": "harold"}]
@bittrance
bittrance / README.md
Created July 9, 2021 20:09
Malicious actor replacing upstream does not faze Git

Some evil haxxor replaced upstream!

Repo iteration 1

[21:41] mkdir repo
[21:41] cd repo/
[21:41] git init .
Initialized empty Git repository in /Users/bittrance/tmp/repo/.git/
[21:41] echo 1 > ze-file

Original repository

A simple repository with two commits.

$ mkdir repo
$ cd repo/
$ git init .
Initialized empty Git repository in /Users/bittrance/tmp/repo/.git/
$ echo 1 > ze-file
@bittrance
bittrance / main.go
Created November 12, 2021 19:47
go-memdb test uint64
package main
import (
"fmt"
"math/rand"
"os"
"time"
memdb "github.com/hashicorp/go-memdb"
)