Skip to content

Instantly share code, notes, and snippets.


Miguel Araujo miguelarauj1o

View GitHub Profile
miguelarauj1o /
Created Aug 24, 2016 — forked from staltz/
The introduction to Reactive Programming you've been missing
View RandomNumbers.swift
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 /
Created Nov 1, 2016 — forked from kevin-smets/
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font (OS X / macOS)
View gist:757275804a8d59f4034d2351ab0babb8
import Cocoa
class GeneralThing<S> {
var stuff: S?
func doIt() {
if let s = stuff {
miguelarauj1o / Makefile
Created Nov 28, 2016 — forked from leandrosilva/Makefile
Makefile to compile, run, and test Erlang applications
View Makefile
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 /
Created Dec 14, 2016 — forked from robertoaloi/
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 / example.erl
Created Dec 14, 2016 — forked from kevsmith/example.erl
Example of gen_server template output
View example.erl
%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ts=4 sw=4 et
%% @author Kevin Smith <>
%% @copyright 2011 Opscode, Inc.
View mymodule.erl
start_link() ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
crash() ->
gen_server:cast(?MODULE, crash).
handle_cast(crash,State) ->
{stop, error, State};
miguelarauj1o /
Created Mar 7, 2017 — forked from gitaarik/
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
miguelarauj1o / The Technical Interview Cheat
Created Jun 22, 2017 — forked from TSiege/The Technical Interview Cheat
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.