Skip to content

Instantly share code, notes, and snippets.

@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@drj42
drj42 / org-mode-reference-in.org
Created February 6, 2012 23:53
This is a cheat sheet for Emacs org-mode... in org-mode format!
@phred
phred / tiny.markdown
Created October 14, 2012 12:30
Solving Embarrasingly Simple Problems in Factor

Solving Embarrasingly Simple Problems in Factor

This Article has struck a chord with me. I'm not an Erlang-er, but the style he describes of "writing many tiny functions" strongly reminds me of why I've come to love Factor.

Drink Beer when Delicious

@andelf
andelf / beam_decompile.erl
Created March 19, 2013 03:25
Erlang BEAM file decompile to .erl file
#!/usr/bin/env escript
% -*- mode: erlang -*-
main([BeamFile]) ->
{ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(BeamFile,[abstract_code]),
io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]).
@ericmoritz
ericmoritz / erlmonad.erl
Last active December 18, 2015 05:39
I think I finally understand monads!
-module(erlmonad).
-compile(export_all).
half(X) when X rem 2 =/= 0 ->
nothing;
half(X) ->
X div 2.
@bookshelfdave
bookshelfdave / contact.md
Last active December 19, 2015 21:58
Contact language
/* comments */
// comments

Connections, misc

// default connection, this is used if a named connection 
// is not specified in a fetch, put, delete
simple_test() ->
{ok, EC} = erasuerl:new(),
{ok, Bin} = file:read_file("/usr/share/dict/words"),
{MD, KBins, MBins} = erasuerl:encode(EC, Bin),
[K1, K2, K3, K4, K5, K6, K7, K8, K9] = KBins,
[M1, M2, M3, M4] = MBins,
KBins2 = [undefined, undefined, undefined, K4, K5, K6, K7, K8, K9],
MBins2 = [undefined, M2, M3, M4],
Bin = iolist_to_binary(erasuerl:decode(EC, MD, KBins2, MBins2)).

Step 1: From you logs I have decoded the bucket/key

binary_to_term(<<131,109,0,0,0,9,85,114,108,84,111,83,99,97,110>>).
<<"UrlToScan">>
binary_to_term(<<131,109,0,0,0,61,104,116,116,112,37,51,97,37,50,102,37,50,102,119,119,119,46,97,110,104,114,105,46,110,101,116,37,50,102,37,51,102,102,101,101,100,37,51,100,114,115,115,50,37,50,54,97,109,112,37,51,98,112,37,51,100,55,51,49,49,48>>).
<<"http%3a%2f%2fwww.anhri.net%2f%3ffeed%3drss2%26amp%3bp%3d73110">>

Step 2: Please run the below snippits from riak attach to identify the owning partitions of this bucket/key

@angrycub
angrycub / force-remove.md
Created September 12, 2013 13:08
`riak-admin force-remove` should not exist.

riak-admin force-remove should not exist.

It's Friday evening, almost time to head out of the office for a nice long weekend. Your Riak cluster has been running along, everything fine. All of a sudden, the SSD in one of your Riak nodes decides to go up in a ball of flames. So you, being the good sysadmin that you are, immediately hop on the phone with your hardware vendor and order a new SSD. They tell you that you'll have it on Monday morning. Clearly you can't leave a broken node in your Riak environment, so you'll want to remove it from the cluster. You sit down at your terminal, hop on to a working Riak node and type

riak-admin force-remove riak@deadnode.mycompany.com

NOOOOOOOOOOOOOOOOOOOOOOOOO!!!!

@zkessin
zkessin / WhyUseWebmachine.md
Last active December 22, 2015 23:39
Talk Proposal for CodeMesh 2013

Why You should use Erlang for your startup's API

Zachary Kessin zkessin@gmail.com Director of API Product Structure Mostly Erlang Podcast

Building a statup in which an API plays a key part is an increasingly common pursuit. People have used many technologies to build those APIs,