Skip to content

Instantly share code, notes, and snippets.

out.txt
out-sorted.txt
words.txt
@beesandbombs
beesandbombs / squareZoom.pde
Created October 16, 2018 18:17
square zoom
// zooming squares. by dave
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
@habibutsu
habibutsu / elixir_to_erlang.erl
Last active August 10, 2019 16:46
Elixir to Erlang
% erl -pa /usr/share/elixir/1.0.5/lib/*/ebin -elixir ansi_enabled true
application:ensure_all_started(elixir),
rr("/usr/share/elixir/1.0.5/lib/elixir/src/elixir.hrl").
% A simplified version of 'Elixir.Code':eval_string/2
% https://github.com/elixir-lang/elixir/blob/v1.2.0/lib/elixir/lib/code.ex#L159
EvalString = fun(String, Binding) ->
% Converts a given string (char list) into quote expression
% https://github.com/elixir-lang/elixir/blob/v1.2.0/lib/elixir/src/elixir.erl#L252
@behe
behe / gc_count.exs
Last active November 11, 2016 09:38 — forked from samuell/gc_count.exs
defmodule ATGCCount do
def count(sequence), do: cnt(String.to_char_list(sequence),0,0)
def cnt([65|t],at,gc), do: cnt(t,at+1,gc)
def cnt([84|t],at,gc), do: cnt(t,at+1,gc)
def cnt([71|t],at,gc), do: cnt(t,at,gc+1)
def cnt([67|t],at,gc), do: cnt(t,at,gc+1)
def cnt([62|_],at,gc), do: {at,gc}
def cnt([],at,gc), do: {at,gc}
# def cnt(_,0,0), do: {0,0}
def cnt([_|t], at, gc), do: cnt(t,at,gc)
@stbaer
stbaer / tinytest.api
Last active November 15, 2016 19:10
Meteor tinytest api
test.isFalse(v, msg)
test.isTrue(v, msg)
test.equal(actual, expected, message, not)
test.length(obj, len)
test.include(s, v)
test.isNaN(v, msg)
test.isUndefined(v, msg)
test.isNotNull
test.isNull
test.throws(func)
@willurd
willurd / web-servers.md
Last active May 9, 2024 05:48
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@adaburrows
adaburrows / functional_php_web_app.php
Created April 26, 2011 05:31
Sketch of how to make a functional style controller in PHP
<?php
/**
* This is by no means complete, but it's a sketch of an idea I had to create a
* classless functional style framework for PHP.
*
* It might turn out to be something cool!
*/
// This function allows creating a new function from two functions passed into it
function compose(&$f, &$g) {