Skip to content

Instantly share code, notes, and snippets.

View etrepum's full-sized avatar
😎
Currently retired

Bob Ippolito etrepum

😎
Currently retired
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@etrepum
etrepum / merge_sort.erl
Created September 24, 2013 18:26
Bottom-up Merge Sort in Erlang and Python
-module(merge_sort).
-export([merge_sort/1]).
% bottom-up merge sort
merge_sort([]) ->
[];
merge_sort(L) ->
iterate([[X] || X <- L]).
iterate([Xs]) ->
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@etrepum
etrepum / ipynb.ipynb
Created November 1, 2018 03:30
Solve for wings
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@etrepum
etrepum / boyerMoore.js
Last active April 15, 2018 20:23
Boyer-Moore in JavaScript, because Uint8Array doesn't have an indexOf.
function asUint8Array(input) {
if (input instanceof Uint8Array) {
return input;
} else if (typeof(input) === 'string') {
// This naive transform only supports ASCII patterns. UTF-8 support
// not necessary for the intended use case here.
var arr = new Uint8Array(input.length);
for (var i = 0; i < input.length; i++) {
var c = input.charCodeAt(i);
if (c > 127) {
@etrepum
etrepum / gist:2655724
Created May 10, 2012 20:36
Cowboy graceful acceptor shutdown
-export([graceful_stop/1, graceful_stop_proc/1]).
graceful_stop(Timeout) ->
lists:foreach(fun stop_listener/1, supervisor:which_children(cowboy_sup)),
proc_lib:spawn(?MODULE, graceful_stop_proc, [Timeout]).
graceful_stop_proc(Timeout) ->
true = register(graceful_stop, self()),
lager:critical("SHUTDOWN with timeout of ~p msec", [Timeout]),
TRef = erlang:start_timer(Timeout, self(), not_so_graceful),
@etrepum
etrepum / avatar.css
Created February 11, 2014 22:31
Mission Bit Intro 03 - Avatar
/*
Resources:
Learn more about colors here:
- https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
Having trouble with overriding rules? Learn about CSS specificity:
- http://specificity.keegan.st/
@etrepum
etrepum / dice.css
Last active September 29, 2016 18:23
Mission Bit Intro #8 - Dice Game
body {
background: linear-gradient(to top, green, black);
height: 100%;
background-repeat: no-repeat;
background-attachment: fixed;
margin: 0;
color: white;
}
div.game {
ruby '2.2.4'
source 'https://rubygems.org'
gem 'numbers_in_words'
gem 'money'