Skip to content

Instantly share code, notes, and snippets.

View miguelarauj1o's full-sized avatar
🎯
Focusing

Miguel Araujo miguelarauj1o

🎯
Focusing
View GitHub Profile

Videos

@miguelarauj1o
miguelarauj1o / introrx.md
Created August 24, 2016 00:58 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
import Darwin
public func arc4random <T: IntegerLiteralConvertible> (type: T.Type) -> T {
var r: T = 0
arc4random_buf(&r, UInt(sizeof(T)))
return r
}
public extension UInt {
public static func random(lower: UInt = min, upper: UInt = max) -> UInt {
@miguelarauj1o
miguelarauj1o / iterm2-solarized.md
Created November 1, 2016 22:39 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font (OS X / macOS)

Solarized

import Cocoa
class GeneralThing<S> {
var stuff: S?
func doIt() {
if let s = stuff {
doWithStuff(s)
}
}
@miguelarauj1o
miguelarauj1o / Makefile
Created November 28, 2016 22:51 — forked from leandrosilva/Makefile
Makefile to compile, run, and test Erlang applications
APP_NAME := my_awesome_app
all: compile
compile: clear
@cp src/$(APP_NAME).app ebin/
@erlc -pa ebin/ -o ebin/ src/*.erl
compile_test: compile
@erlc -pa ebin/ -o ebin/ test/*.erl
@miguelarauj1o
miguelarauj1o / kill-erlang-node.sh
Created December 14, 2016 03:33 — forked from robertoaloi/kill-erlang-node.sh
Kill an Erlang process by node name
#!/usr/bin/env bash
# Kill an Erlang process by node name
#
# e.g.: kill-erlang-node kred
# Check usage
if [ -z "$1" ]; then
echo "Usage: `basename $0` NODE_NAME"
exit 1
@miguelarauj1o
miguelarauj1o / example.erl
Created December 14, 2016 03:34 — forked from kevsmith/example.erl
Example of gen_server template output
%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ts=4 sw=4 et
%% @author Kevin Smith <kevin@opscode.com>
%% @copyright 2011 Opscode, Inc.
-module(example).
-behaviour(gen_server).
-export([start_link/0]).
-module(mymodule).
start_link() ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
...
crash() ->
gen_server:cast(?MODULE, crash).
...
handle_cast(crash,State) ->
{stop, error, State};
...
@miguelarauj1o
miguelarauj1o / offenses.txt
Last active March 7, 2017 22:47
`rubocop --format json` in Homebrew to inspect `brew audit --strict` fails
rubocop --format offenses
12 Style/UnneededCapitalW
11 Lint/UnneededSplatExpansion
11 Style/UnneededInterpolation
8 Style/MultilineIfModifier
8 Style/RedundantParentheses
8 Style/TrailingCommaInArguments
6 Homebrew/CorrectBottleBlock
6 Style/MultilineArrayBraceLayout