Skip to content

Instantly share code, notes, and snippets.

View cararemixed's full-sized avatar
🏳️‍🌈

Cara Mitchell cararemixed

🏳️‍🌈
View GitHub Profile
@egobrain
egobrain / cowboy_multipart_uploader.erl
Created May 30, 2012 06:47
Cowboy files uploader.
%%%-------------------------------------------------------------------
%%% @author egobrain <egobrain@linux-ympb>
%%% @copyright (C) 2012, egobrain
%%% @doc
%%% Function for uploading files and properties,which were sent as a
%%% multipart. Files are stored in tmp_folder with random name,
%%% generated by tmp_filename function.
%%% @end
%%% Created : 25 Mar 2012 by egobrain <egobrain@linux-ympb>
%%%-------------------------------------------------------------------
@dherman
dherman / explanation.txt
Last active December 13, 2015 04:59
demonstrating that lexing JavaScript requires a pushdown automaton
Looking at the preceding token when the lexer points to a '/'
character is insufficient to determine which context it's in. In
fact, you need to look at an arbitrary number of preceding tokens
to figure it out. This example demonstrates a case where we can
pump up the number of preceding tokens to an arbitrary size
before you can disambiguate your syntactic context.
@pbailis
pbailis / rapgenius-balancing.md
Last active July 23, 2019 12:57
Randomized load balancing comparison

RapGenius has an interesting post about Heroku's randomized load balancing, complaining about how random placement degrades performance compared to prior omniscient approaches. RapGenius ran some simulations, including an experiments with a "Choice of Two" method:

Choice of two routing is the naive method from before, with the twist that when you assign a request to a random dyno, if that dyno is already busy then you reassign the request to a second random dyno, with no regard for whether the second dyno is busy

This differs subtly but substantially from the standard "Power of Two Choices" randomized load balancing:

each [request] is placed in the least loaded of d >= 2 [Dynos] chosen independently and uniformly at random

Take a look at the difference in queue lengths below, for 200 Dynos, 100

@kevsmith
kevsmith / bench.erl
Last active December 14, 2015 07:09
Simple Erlang message passing benchmark
-module(bench).
-export([run_suite/3, run/1]).
run_suite(Name, Passes, Messages) ->
Results = run_suite1(Passes, Messages, []),
Avg = lists:sum(Results) / Passes,
StdDev = math:sqrt(lists:sum([math:pow(X - Avg, 2) || X <- Results]) / Passes),
Summary = [{avg, Avg}, {stddev, StdDev}, {min, lists:min(Results)},
{max, lists:max(Results)}],
@pbailis
pbailis / list.md
Last active April 15, 2018 08:54
Quick and dirty (incomplete) list of interesting, mostly recent data warehousing/"big data" papers

A friend asked me for a few pointers to interesting, mostly recent papers on data warehousing and "big data" database systems, with an eye towards real-world deployments. I figured I'd share the list. It's biased and rather incomplete but maybe of interest to someone. While many are obvious choices (I've omitted several, like MapReduce), I think there are a few underappreciated gems.

###Dataflow Engines:

Dryad--general-purpose distributed parallel dataflow engine
http://research.microsoft.com/en-us/projects/dryad/eurosys07.pdf

Spark--in memory dataflow
http://www.cs.berkeley.edu/~matei/papers/2012/nsdi_spark.pdf

@KonTrax
KonTrax / 00_tableOnly.py
Last active November 23, 2020 08:09
SublimeText3 Theme Overview
#### ALL CLASSES
# Unsorted at the moment
|===========================|======|==================|====================|=================|========|==================|
| CLASS | TYPE | ATTRIBUTES | PROPERTIES | FONT.PROPERTIES | LAYERS | LAYER.PROPERTIES |
|===========================|======|==================|====================|=================|========|==================|
| auto_complete | | | row_padding | | layer0 | tint |
| | | | dark_content | | | opacity |
|---------------------------|------|------------------|--------------------|-----------------|--------|------------------|
| auto_complete_label | | | fg | | | |
| | | | match_fg | | |
@taliesinb
taliesinb / gist:5848321
Created June 24, 2013 07:28
List of 'essential functions' that every Mathematica programmer should know
Equal
SameQ
MatchQ
MemberQ
Take
Drop
Head
Most
Rest
Part
@cmeiklejohn
cmeiklejohn / topics.md
Last active December 19, 2015 19:49
Think Distributed Podcast Topics
  • CRDTs
    • What are CRDTs?
  • Vector clocks
    • How do these related to dotted version vectors?
  • Causal consistency
    • CAC proof
  • Rack awareness and multi-data center deployments
    • What is this?
    • Why is this important?
  • Wait-free synchronization
@cemerick
cemerick / defonce.clj
Created August 25, 2013 03:01
`defonce` for ClojureScript
(ns whatever.cljs
(:require [cljs.compiler :refer (munge)])
(:refer-clojure :exclude (munge defonce)))
(defmacro defonce
[vname expr]
(let [ns (-> &env :ns :name name munge)
mname (munge (str vname))]
`(when-not (.hasOwnProperty ~(symbol "js" ns) ~mname)
(def ~vname ~expr))))