Skip to content

Instantly share code, notes, and snippets.

View rafaeljesus's full-sized avatar

Rafael Jesus rafaeljesus

  • Berlin, Germany
View GitHub Profile
@rafaeljesus
rafaeljesus / linkedin-unfollow-everyone.js
Created November 18, 2021 17:53 — forked from brunolemos/linkedin-unfollow-everyone.js
Unfollow everyone on Linkedin
(() => {
let count = 0;
function getAllButtons() {
return document.querySelectorAll('button.is-following') || [];
}
async function unfollowAll() {
const buttons = getAllButtons();
@rafaeljesus
rafaeljesus / system_design_numbers_cheat_sheet.md
Created August 8, 2021 15:59 — forked from mwakaba2/system_design_numbers_cheat_sheet.md
Updated easy to remember system design numbers for back-of-the-envelope calculations

Updated, easy to remember numbers for back-of-the-envelope calculations in system design interviews

Powers of two table

Power    Approx Value (Bytes)       Bytes
-----------------------------------------
10                 1 thousand        1 KB
16                16 thousand       64 KB
20                  1 million        1 MB
30 1 billion 1 GB
@rafaeljesus
rafaeljesus / grpc-load-balancing.md
Created March 16, 2021 10:54 — forked from rponte/grpc-load-balancing.md
gRPC Load Balancing may not be that easy

Why gRPC load balancing is so tricky?

At a high-level, we need to understand two points:

  • gRPC is built on HTTP/2, and HTTP/2 is designed to have a single long-lived TCP connection (a sticky and persistent connection);
  • To do gRPC load balancing, we need to shift from connection balancing to request balancing;

Some interesting articles about this subject

@rafaeljesus
rafaeljesus / NearbyWords.java
Created February 22, 2021 20:00 — forked from alexrios/NearbyWords.java
Facebook's How to Crush Your Coding Interview. Problem: Write a function that given a string, returns all nearby words. You are given the following helper functions: Set<String> getNearbyChars(char c); isWord(String word);
package facebook;
import java.util.HashSet;
import java.util.Set;
/**
* The complexity of that algorithm is O(n^m), where:
* n - the length of a string.
* m - number of permutations.
*/
package main
import (
"bufio"
"flag"
"fmt"
"io"
"os"
"path/filepath"
"regexp"

Quick cheat sheet of helpful tmux commands

  1. tmux new - Create and attach to a new session.
  2. tmux new -s NAME_HERE - Create and attach to a new session named NAME_HERE.
  3. CTRL-b, d - Detach (i.e. exit) from the currently-opened tmux session (alternatively, tmux detach). Note, this means press and hold CTRL, press b, release both, press d.
  4. tmux ls - Show list of tmux sessions.
  5. tmux a - Attach to the previously-opened tmux session.
  6. tmux a -t NAME_HERE - Attach to the tmux session named NAME_HERE.
  7. CTRL-d - Delete (i.e. kill) currently-opened tmux session (alternatively tmux kill-session).
  8. CTRL-b, [ - Enter copy mode, and enable scrolling in currently-opened tmux session. Press q to exit.
  9. CTRL-b, " - Split window horizontally (i.e. split and add a pane below).
@rafaeljesus
rafaeljesus / cloud_sql_flags.md
Created October 5, 2020 18:13 — forked from stfeng2/cloud_sql_flags.md
Cloud SQL Flags Tuning

Important Notice

  • ❗ All flags and settings described here are subject to change without any notice.
  • Last update: September 2017

Introduction

This document describes a set of MySQL flags that have been tuned in Google Cloud SQL (Second Generation) to make the out-of-box experience better on Google Cloud. This is for your reference only, with the hope that some of the settings might also be useful outside the Google Cloud environment.

innodb_buffer_pool_size

What Hiring Should Look Like

This is definitely not the first time I've written about this topic, but I haven't written formally about it in quite awhile. So I want to revisit why I think technical-position interviewing is so poorly designed, and lay out what I think would be a better process.

I'm just one guy, with a bunch of strong opinions and a bunch of flaws. So take these suggestions with a grain of salt. I'm sure there's a lot of talented, passionate folks with other thoughts, and some are probably a lot more interesting and useful than my own.

But at the same time, I hope you'll set aside the assumptions and status quo of how interviewing is always done. Just because you were hired a certain way, and even if you liked it, doesn't mean that it's a good interview process to repeat.

If you're happy with the way technical interviewing currently works at your company, fine. Just stop, don't read any further. I'm not going to spend any effort trying to convince you otherwise.

@rafaeljesus
rafaeljesus / listchars.vim
Created June 9, 2020 12:30 — forked from while0pass/listchars.vim
show/hide hidden characters in Vim
" hide hidden chars
:set nolist
" show hidden characters in Vim
:set list
" settings for hidden chars
" what particular chars they are displayed with
:set lcs=tab:▒░,trail:▓,nbsp:░
" or
@rafaeljesus
rafaeljesus / k8s-cluster-module.tf
Last active December 1, 2020 07:03
k8s cluster creation terraform
module "vpc" {
source = "git::git@github.com:rafaeljesus/vpc?ref=master"
vpc_id = var.vpc_id
vpc_cidr_block = var.vpc_cidr_block
azs = slice(data.aws_availability_zones.available.names, 0, 3)
public_subnets = var.vpc_public_subnets
private_subnets = var.vpc_private_subnets
igw_id = var.vpc_igw_id