Skip to content

Instantly share code, notes, and snippets.

finding my happy place...

Sonny Scroggin scrogson

finding my happy place...
View GitHub Profile
scrogson /
Created May 16, 2020 — forked from anonymous/
Shared via Rust Playground
extern crate hyper;
extern crate reqwest;
use reqwest;
use std::io::Read;
header! { (ContentType, "Content-Type") => [String] }
header! { (ContentLength, "Content-Length") => [usize] }
View Dockerfile
FROM node:12.2-slim as assets
WORKDIR /app/assets
COPY assets/package*.json ./
RUN npm install
# Copy the entire app so we can put files into /app/priv/static
COPY . /app
use std::future::Future;
use tokio::runtime::{Builder, Runtime};
use tokio::task::JoinHandle;
lazy_static::lazy_static! {
static ref TOKIO: Runtime = Builder::new()
.expect("Franz.Native: Failed to start tokio runtime");
scrogson / after.valgrind.log
Last active Dec 11, 2019
Rustler Segfault - OwnedEnv::send_and_clear
View after.valgrind.log
==14241== Memcheck, a memory error detector
==14241== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==14241== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==14241== Command: /home/scrogson/otp/bin/x86_64-unknown-linux-gnu/beam.valgrind.smp -S 8:8 -SDcpu 8:8 -- -root /home/scrogson/otp -progname /home/scrogson/otp/bin/cerl\ -valgrind -- -home /home/scrogson -- -kernel shell_history enabled -- --track-origins=yes -kernel shell_history enabled -pa /usr/local/lib/elixir/bin/../lib/eex/ebin /usr/local/lib/elixir/bin/../lib/elixir/ebin /usr/local/lib/elixir/bin/../lib/ex_unit/ebin /usr/local/lib/elixir/bin/../lib/iex/ebin /usr/local/lib/elixir/bin/../lib/logger/ebin /usr/local/lib/elixir/bin/../lib/mix/ebin -elixir ansi_enabled true -noshell -s elixir start_cli -- -- -extra /usr/local/bin/mix test
==14241== Warning: set address range perms: large range [0x643d000, 0x4643d000) (noaccess)
warning: variable "i" is unused (if the variable is not meant to be us
View kafka.bnf
# generated code, do not edit!
#ApiKey: Produce, 0
ProduceRequestV0 => acks timeout [topic_data]
acks => INT16
timeout => INT32
topic_data => topic [data]
topic => STRING
data => partition record_set
partition => INT32

Keybase proof

I hereby claim:

  • I am scrogson on github.
  • I am scrogson ( on keybase.
  • I have a public key ASDCQthqJvMSr2oa_EFbEiJAcnQmuQZuW1sGh80eE3jzVwo

To claim this, I am signing this object:

View beam_opcodes.erl
%% Warning: Do not edit this file.
%% Auto-generated by 'beam_makeops'.
-spec format_number() -> 0.
format_number() -> 0.
scrogson /
Created Jul 10, 2017
Assigns like Plug's conn.assigns - but type safe
use ::std::collections::HashMap;
use ::std::any::{TypeId, Any};
struct Assigns {
map: HashMap<TypeId, Box<Any>>,
trait AssignHandle {
type MapsTo;
scrogson /
Created Jul 8, 2017
Basic Rust HTTP Router
use std::collections::HashMap;
type Headers = HashMap<String, String>;
type BoxedCallback = Box<Fn(Conn) -> Conn>;
struct Request {
method: String,
url: String,
You can’t perform that action at this time.