Skip to content

Instantly share code, notes, and snippets.

Working from home

Leo Dutra leodutra

Working from home
View GitHub Profile
leodutra /
Created Feb 19, 2018 — forked from staltz/
The introduction to Reactive Programming you've been missing
leodutra / destructuring.js
Created Feb 19, 2018 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic:
View destructuring.js
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
leodutra /
Created Apr 15, 2018 — forked from SalahAdDin/
Instlling React-Native Android Environment in ArchLinux

First step: Install Android SDK

  1. yaourt -S android-sdk android-sdk-platform-tools android-sdk-build-tools
    Note: Maybe you'll have problems with the lasta package: ncurses5-compat-libs. In order to avoid this problem you have to use this command: gpg --recv-keys F7E48EDB. You can find clarification (here)[].
  2. yaourt -S genymotion
    Note: You'll need install virtual-box and his modules, yaourt will make for you but you need choos between ArchLinux host modules or DKMS host modules.
  3. echo -e "vboxdrv\nvboxnetflt\nvboxnetadp\nvboxpci" > /etc/modules-load.d/virtualbox.conf
    Note: You need do this with super user because need super user permissions and with sudo, for us at least, doesn't work.
  4. sudo modprobe vboxdrv vboxnetadp vboxnetflt
    Activate for current session.
  5. sudo chmod -R 777 /opt/android-sdk
View react-native-two-column-layout.jsx
<View style={{ justifyContent: 'center', alignItems: 'center', flexDirection: 'row', flex: 1}}>
leodutra / hyper.js
Created Jun 15, 2018 — forked from coco-napky/hyper.js
Hyper config for git bash in Windows
View hyper.js
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
leodutra / dedent-template.js
Created Jun 28, 2018 — forked from zenparsing/dedent-template.js
Dedenting Template Strings
View dedent-template.js
function dedent(callSite, ...args) {
function format(str) {
let size = -1;
return str.replace(/\n(\s+)/g, (m, m1) => {
if (size < 0)
size = m1.replace(/\t/g, " ").length;
View Arch Linux mkinitcpio: Possibly missing firmware for


In Arch Linux mkinitcpio -p linux


Possibly missing firmware for module: aic94xx
 Possibly missing firmware for module: wd719x
leodutra / latency.markdown
Created Jan 26, 2019 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know
View latency.markdown

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns  = 250 µs
leodutra / index.js
Last active Jun 29, 2019 — forked from malyw/index.js
Capture DOM elements screenshot using Chrome headless
View index.js
const puppeteer = require('puppeteer')
// Related Issues:
// 3118 -
async function main() {
const browser = await puppeteer.launch({
args: ['--start-maximized'],
headless: false,
defaultViewport: null
leodutra /
Created Jun 29, 2019 — forked from johncantrell97/
How I Obtained Satoshi's Treasure Keys 1, 2, and 3 in Minutes

Today (April 16th 2019 at noon) the first major clues to discover key #1 was set to be released in a few cities. A QR code with the words 'orbital' were found at these locations and looked like this: ( If you read the QR code with your phone you will be directed to this url:

At this URL you are prompted to input a passphrase to decrypt the first shard. An obvious first guess was to try the word 'orbital' from the QR code. Not suprisingly this worked! This reveals a congratulations page and presents the first key shard:


Now, we were supposed to wait until April 17th to get clues from the other cities for keys #2 and #3 but that wouldn't stop me from digging around with all the new information we had. All that time "playing" notpron ( years ago was going to help me here.

The first thing I noticed was