Skip to content

Instantly share code, notes, and snippets.

View emerleite's full-sized avatar

Emerson Macedo emerleite

View GitHub Profile
/**
* SocketManager - Singleton to manage multi-channel socket 'routing', need a way to merge with socket.io so client sessions aren't stored twice in memory,
*
* Requires Socket.IO-node and Socket.IO client libraries.
*
* Usage:
* in your main app.js file (or whereever you create the server)
*
* var io = require('socket.io'),
* sm = require('socketmanager');
@emerleite
emerleite / install_elixir.md
Created April 10, 2016 22:13 — forked from rubencaro/install_elixir.md
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then kerl and exenv are your best friends.

@emerleite
emerleite / udp_server.exs
Created April 26, 2021 13:16 — forked from joshnuss/udp_server.exs
Fault tolerant UDP Server in Elixir
# to run:
# > elixir --no-halt udp_server.exs
# to test:
# > echo "hello world" | nc -u -w0 localhost:2052
# > echo "quit" | nc -u -w0 localhost:2052
# Let's call our module "UDPServer"
defmodule UDPServer do
# Our module is going to use the DSL (Domain Specific Language) for Gen(eric) Servers
use GenServer
@emerleite
emerleite / emulator-install-using-avdmanager.md
Created March 28, 2021 22:14 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For generic skin emulator with default apis (without google apis):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-29;default;x86"

@emerleite
emerleite / tail_call_optimized.py
Created July 13, 2020 18:25 — forked from porcow/tail_call_optimized.py
Tail Call Optimization Decorator (Python recipe)
## {{{ http://code.activestate.com/recipes/474088/ (r1)
#!/usr/bin/env python2.4
# This program shows off a python decorator(
# which implements tail call optimization. It
# does this by throwing an exception if it is
# it's own grandparent, and catching such
# exceptions to recall the stack.
import sys
@emerleite
emerleite / dicas.md
Created March 22, 2020 21:31 — forked from dmvieira/dicas.md
Dicas para entrar na área de dados

Como entrar na Área de Dados

Base

Então, vamos lá... Como material inicial para orientação temos o guia datascience.pizza... Se você prefere Podcast pode olhar o Pizza de Dados e o Data Hackers. Querendo um curso presencial, os únicos que indico são do Data Bootcamp que dou aula: https://databootcamp.com.br ... Para curso online existem vários no Coursera, Udemy, etc... Tem em português na Alura. Sobre o DataScienceAcademy eu não gosto muito e nem indico por várias questões.

Social

Você já tem Telegram? Se não, é muito bom entrar e olhar nos seguintes grupos que eu confio para saber das novidades e trocar uma ideia:

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

"npm install socket-io" & you are ready to go
@emerleite
emerleite / decode.txt
Created November 12, 2018 17:53 — forked from michalmuskala/decode.txt
Jason benches
Operating System: macOS"
CPU Information: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Number of Available Cores: 8
Available memory: 16 GB
Elixir 1.7.0-dev
Erlang 21.0
Benchmark suite executing with the following configuration:
warmup: 5 s
time: 30 s