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 / gist:82b395e365d910f79c3b613fdb693656
Last active January 20, 2021 21:35
Kent Beck - Paint Drip People

Kent Beck - Paint Drip People

Keith Adams worked on kernels at VM Ware. Then virtual machines. Then search performance at Facebook. Then the HHVM implementation of PHP. Then machine learning. Now he’s Chief Architect at Slack. In between he worked on hundreds of little projects that lasted hours or days or weeks. Keith is a Paint Drip Person.

I was a big fan of the T model of skills, introduced by David Guest in 1991: know about a lot of things, be really good at one. The more I taught it, the more unhappy I got with the metaphor:

  • Skilled people are good at several things.
  • Skilled people’s interests develop over time.
  • Skilled people don’t plan their next focus area. Sometimes it seems completely unrelated to their previous focus area.
@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