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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type HttpResp struct { | |
Id string | |
Resp *http.Response | |
Err error | |
} | |
func AsyncGet(urls map[string]string) []*HttpResp { | |
ch := make(chan *HttpResp) | |
responses := []*HttpResp{} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Promise = require('bluebird'); | |
var funcs = Promise.resolve([500, 100, 400, 200].map((n) => makeWait(n))); | |
funcs | |
.each(iterator) // logs: 500, 100, 400, 200 | |
.then(console.log) // logs: [ [Function], [Function], [Function], [Function] ] | |
funcs | |
.mapSeries(iterator) // logs: 500, 100, 400, 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
let count = 0; | |
function getAllButtons() { | |
return document.querySelectorAll('button.is-following') || []; | |
} | |
async function unfollowAll() { | |
const buttons = getAllButtons(); |
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;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"flag" | |
"fmt" | |
"io" | |
"os" | |
"path/filepath" | |
"regexp" |
tmux new
- Create and attach to a new session.tmux new -s NAME_HERE
- Create and attach to a new session named NAME_HERE.CTRL-b, d
- Detach (i.e. exit) from the currently-opened tmux session (alternatively,tmux detach
). Note, this means press and holdCTRL
, pressb
, release both, pressd
.tmux ls
- Show list of tmux sessions.tmux a
- Attach to the previously-opened tmux session.tmux a -t NAME_HERE
- Attach to the tmux session named NAME_HERE.CTRL-d
- Delete (i.e. kill) currently-opened tmux session (alternativelytmux kill-session
).CTRL-b, [
- Enter copy mode, and enable scrolling in currently-opened tmux session. Pressq
to exit.CTRL-b, "
- Split window horizontally (i.e. split and add a pane below).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
receivers: | |
################################################### | |
## Slack Receivers | |
- name: slack-code-owners | |
slack_configs: | |
- channel: '#{{- template "slack.monzo.code_owner_channel" . -}}' | |
send_resolved: true | |
title: '{{ template "slack.monzo.title" . }}' | |
icon_emoji: '{{ template "slack.monzo.icon_emoji" . }}' | |
color: '{{ template "slack.monzo.color" . }}' |
NewerOlder