Skip to content

Instantly share code, notes, and snippets.

@alexmoore
alexmoore / 0. Riak on Raspberry Pi's
Last active Nov 18, 2021
Building Basho Erlang / Riak TS on a Raspberry Pi 3
View 0. Riak on Raspberry Pi's
This is unsupported by Basho, but you can build Basho's flavor of Erlang and Riak on Raspberry Pis.
View erl_helpers.sh
function list_erlangs() {
read -ra AvailableErls <<< `ls -l $ERL_HOME | awk '/^d/' | cut -d ' ' -f12-`
Current=`ls -l $ERL_HOME | awk '/^l/' | sed 's/^l.*-> \(.*\)/\1/'`
for i in "${AvailableErls[@]}"; do
if [ $i = $Current ]; then echo "$Current *"; else echo $i; fi
done
}
function change_current_erlang() {
Target=$1
@alexmoore
alexmoore / service-checklist.md
Created Sep 27, 2016 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist
View service-checklist.md

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
View New Client Eng Reading List
Just Open a Socket - https://www.youtube.com/watch?v=jytJXjI0oQU
View oh-the-schemas-you-can-scheme.md

#Oh the Schemas you can Scheme!

You can scheme about scaling
Of which SQL can only dream!
You can scheme about NoSQL
Oh the schemas you can scheme

Oh, the schemes you can scheme up
if only you try!
If you try, you can scheme up

View Program.cs
using System;
using System.Numerics;
using System.Globalization;
using System.Text;
using System.Diagnostics;
using System.Threading;
namespace StringPaddingTest
{
View js-under-pressure.js
function doubleInteger(i) {
return i*2;
}
function isNumberEven(i) {
return i%2 === 0;
}
function getFileExtension(i) {
if(i.indexOf('.') >= 0) {
@alexmoore
alexmoore / .emacs
Created Sep 30, 2013
Add this to your .emacs file to autoload the tools for the current erlang with https://github.com/alexmoore/erls
View .emacs
;; setup erlang mode
(setq erlang-root-dir "/Users/alex/erlangs/current")
(setq erlang-lib-dir (concat erlang-root-dir "/lib/erlang/lib"))
(setq load-path
(cons (concat erlang-lib-dir
"/"
(car (directory-files erlang-lib-dir nil "^tools\-"))
"/emacs" )
load-path))
View fizzbuzz.erl
-module(fizzbuzz).
-export([print_fizz_buzz/0,fizzbuzz/1]).
print_fizz_buzz() ->
Each = fun(I) ->
print_fizz_buzz(fizzbuzz(I)) end,
lists:foreach(Each, lists:seq(1,100)).
print_fizz_buzz(I) when is_integer(I) -> io:fwrite("~p~n", [I]);
print_fizz_buzz(I) -> io:fwrite("~s~n", [I]).
View public-access-bucket-policy.json
{
"Id": "Policy1371509616384",
"Statement": [
{
"Sid": "Stmt1371509665536",
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::BUCKET_NAME/*",