Skip to content

Instantly share code, notes, and snippets.

finding my happy place...

Sonny Scroggin scrogson

finding my happy place...
Block or report user

Report or block scrogson

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

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,
scrogson / main.go
Last active Jul 10, 2017
Fetch current on call users from Pager Duty for a given schedule_id
View main.go
package main
import (
scrogson / docs.publish.ex
Last active Jul 10, 2017
A Mix Task to Publish docs to GitHub Pages
View docs.publish.ex
defmodule Mix.Tasks.Docs.Publish do
use Mix.Task
@shortdoc "Publishes docs to GitHub Pages"
@moduledoc """
Publishes docs to GitHub Pages.
mix docs.publish [git-remote]
View server.ex
defp gen_jwk_set do
{:ok, pem} = genrsa(2048)
|> JOSE.JWK.from_pem()
|> JOSE.JWK.to_public()
|> JOSE.JWK.to_record()
|> List.wrap()
|> :jose_jwk_set.to_map(%{})
|> Poison.encode()
// OK so to start with here's the EventHandler trait, just like slack-rs
pub trait EventHandler {
// I don't know what kind of thing EventData should be.
// maybe Json? whatever events actually are in phoenix.
fn on_event(&mut self, channel_name: &str, event_type: &str, event_data: EventData);
fn on_connect(&mut self, ...);
fn on_close(&mut self, ...);
fn login_and_run<H: EventHandler>(handler: H, ...) {...}
scrogson / README
Last active May 8, 2018 — forked from ciastek/README
Use bootstrap-sass npm package with Phoenix's brunch
1) install npm packages
2) update brunch-config.js
3) remove Bootstrap from web/static/css/app.css
4) rename web/static/css/app.css to web/static/css/app.scss
5) update web/static/css/app.scss
You can’t perform that action at this time.