Skip to content

Instantly share code, notes, and snippets.

View fearofcode's full-sized avatar
🎵
Take that chance / All day long / Fucking up so fucking strong

Warren Henning fearofcode

🎵
Take that chance / All day long / Fucking up so fucking strong
View GitHub Profile
1 kilo whole wheat flour
700 g water
2 tbsp sugar/honey
1/2 cup starter
3 tsp salt
Measure out and mix the ingredients together in a mixing bowl. You
probably want to mix the dry ingredients together, then dissolve the
starter in the water, then pour the starter-water mixture in, as is
often done when making sourdough bread. Notice that the hydration
If mydate Like "*[abcdefghijklmnopqrstuvwxyz/-" & Chr(150) & "]*" Then
mydate = Replace(Replace(mydate, "January", "01"),
"Jan", "02")
mydate = Replace(Replace(mydate, "Feburary",
"02"), "Feb", "02")
mydate = Replace(Replace(mydate, "March", "03"),
"Mar", "03")
mydate = Replace(Replace(mydate, "April", "04"),
"Apr", "04")
mydate = Replace(mydate, "May", "05")
@fearofcode
fearofcode / gist:247e27abe981d8d474ef
Created July 14, 2014 02:59
two exercises from Sedgewick's Algorithms in C
/* exercises, chapter 3, section 1 */
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <limits.h>
#include <float.h>
#include <math.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_rng.h>
@fearofcode
fearofcode / gist:63aca07f84c3a82c83cd
Created May 26, 2015 05:34
Simple Elasticsearch usage
package org.wkh.learningelasticsearch;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.node.Node;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
http://www.thoughtworks.com/insights/blog/implementing-blue-green-deployments-aws
http://docs.ansible.com/haproxy_module.html
http://martinfowler.com/bliki/BlueGreenDeployment.html
https://spring.io/blog/2014/04/04/project-sagan-zero-downtime-deployments
https://github.com/melix/greenblueboot
https://theholyjava.wordpress.com/2013/09/05/blue-green-deployment-without-breaking-sessions-with-haproxy-and-jetty/
https://codeascraft.com/2013/07/01/atomic-deploys-at-etsy/
@fearofcode
fearofcode / Makefile
Last active March 5, 2016 21:23
Golden monkey simulation
all: golden_monkey_monte_carlo.c
gcc -m64 -O3 -std=c99 -Wall -Werror -Wextra -Wshadow -pedantic \
-Wextra -Wunknown-pragmas -Wfloat-equal -Wcast-qual \
-o gmmc golden_monkey_monte_carlo.c \
-lgsl -lgslcblas -lm
@fearofcode
fearofcode / Makefile
Created March 13, 2016 01:43
simple makefile showing syntax for using extra libraries and useful warning flags
all: lc gmmc
CC=gcc
CFLAGS= -g -m64 -O3 -std=gnu11 -Wall -Werror -Wextra -Wshadow -pedantic \
-Wextra -Wunknown-pragmas -Wfloat-equal -Wcast-qual
LDLIBS= -lgsl -lgslcblas -lm
lc: learning_c.c
$(CC) $(CFLAGS) -o $@ learning_c.c
@::,:;#
@+'#@@@@@#'
###@@@@###@+++
##@@@@@@@@#@@@@;#
++@@@#@@@@@@@@@@@'#
'#@+#'@@@@@@@@@@@@@+
#@+'+'@#@#@+#@@@@@@#+@
#@+++'+@@@@@@@@@@@@@'@
@@@@@:####@@@@@@@@@@@'@
@@@@@#+';'##@@@@@@@@@@@
@fearofcode
fearofcode / gist:5f07ac8fba86c33767ea17ff05e54f7a
Last active December 23, 2017 21:20
postgres loading example
example output from running scripts in https://github.com/fearofcode/nyc-taxi-data follows.
base script, 2tb HDD, vanilla postgres settings fresh from ubuntu install. 4 CPUs, 8 GB VM RAM. ubuntu 16.04, postgres 10.
sedding a 14 million line CSV and then COPYing it in:
Thu Dec 21 23:30:18 PST 2017: beginning load for data/yellow_tripdata_2009-01.csv
COPY 14092413
Thu Dec 21 23:34:57 PST 2017: finished raw load for data/yellow_tripdata_2009-01.csv
@fearofcode
fearofcode / WhatCouldGoWrong.java
Created January 27, 2018 21:39
Type erasure example
class WhatCouldGoWrong<T, U> {
T t;
U u;
public void set(T t) {
this.t = t;
}
public void set(U u) {
this.u = u;