Skip to content

Instantly share code, notes, and snippets.

View edo9k's full-sized avatar
🪲

Eduardo França edo9k

🪲
View GitHub Profile
calc = (a, b, op) => operations[op](a,b)
operations = {
'+': (a, b) => a + b,
'-': (a, b) => a - b,
'*': (a, b) => a * b,
'/': (a, b) => a / b
}
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFtrFYYBEAC2UB4MQCEzfHDe61cbCJXY1grGtoJllIRe+AOkEut9NFadqiG5
+h5r4KPNWnXufbBa7BvBwALYk5Bcs5XlWeaY+kk8wfqM2fd4wDoBJ1xbkZIpKxLw
8JzzDrF34VVPhry6JsS2NkSKxzh0hKhHxiGiwzTxRaKxTTQ/7tkO6cbcAa5gf0bf
HjxMNxpULrrsTuxtguOlTRXCVeAoddHKRdbv9QJCzM/PNd8xClq0WL/VjT/b6hts
tu58hJLgVPwPiUrOami8zBvvg9T8tur77OPIh3fIv6y+RSiku7FVBZ6yN0PRueL+
inDjMmcKPdNMw2/zxCjVazHKOUcVMVYfrf5WwEGGw0MLcQ2Wus1RzKFk/GmLtNZq
gniLcmqoE7jwk7z0JGhewMDJVW/Xv1+kHk+lhlcyJJICf6AKLHQkZ2em1IKq2+u5
09qVlRcfA7DQDTYxTIbUE9JLX1Ob783kX5xo9XGKAAI7N4nToDgfXv+a9kB98He1
@edo9k
edo9k / .prettierrc
Last active July 30, 2019 14:25
ma prettier configs
{
"arrowParens": "avoid",
"bracketSpacing": true,
"endOfLine": "lf",
"insertPragma": true,
"jsxBracketSameLine": true,
"printWidth": 120,
"proseWrap": "always",
"semi": false,
"singleQuote": true,
@edo9k
edo9k / auto-scroll.js
Created April 1, 2019 19:58
Page auto-scroll one liner
// scrolls two pixels down every 25 milliseconds
scroll = setInterval(function(){ window.scrollBy(0, 2); }, 25)
//to remove
// clearInterval(scroll)
@edo9k
edo9k / tinder-autolike.js
Created April 1, 2019 00:50
Tinder auto like one-liner
setInterval(() => document.getElementsByClassName("recsGamepad__button")[2].click(), 2000)
// wrapping a bookmarklet boilerplate around this is a good idea.
@edo9k
edo9k / TIS-100.md
Last active October 19, 2018 00:40 — forked from drguildo/TIS-100.md
TIS-100 Cheat Sheet

TIS-100 Cheat Sheet

Instructions

Name Syntax Description
NOP NOP No operation
MOV MOV <SRC>, <DST> Move value from source to destiny
SWP SWP Swap values of ACC and BAK
SAV SAV Send ACC value to BAK
@edo9k
edo9k / install_php7.sh
Last active February 21, 2018 14:08
Migra uma máquina com Debian Jessie de php5 para php7. (2018-02-21)
#!/bin/bash
#
# Esse script foi feito com as instruções desse tutorial de migração
# https://www.cyberciti.biz/faq/installing-php-7-on-debian-linux-8-jessie-wheezy-using-apt-get/
#
# Testado no Debian Jessie (8.10)
# O computador não explodiu, ainda.
#
if [ "$EUID" -ne 0 ]
@edo9k
edo9k / wayback.js
Created February 21, 2017 13:10
Find cached page version in the WayBackMachine (archive.org).
javascript:(function(){
if (document.URL === "data:text/html,chromewebdata"){
location.href='http://web.archive.org/web/*/'+loadTimeData.data_.summary.failedUrl;
} else {
location.href='http://web.archive.org/web/*/'+document.URL;
}
}())
/* compressed */
@edo9k
edo9k / play-mp3.js
Created February 17, 2017 18:10
Javascript (Bookmarklet) to add a play button to each of the pronunciation files in Omniglots "Useful Phrases" pages. (test it there: http://www.omniglot.com/language/phrases/index.htm)
links = document.getElementsByTagName('a');
for (var i=0; i<links.length; i++){
if (links[i].href.endsWith('.mp3')){
console.log(links[i].href);
var sound = document.createElement('audio');
sound.controls = 'controls';
sound.src = links[i].href;
sound.type = 'audio/mpeg';
@edo9k
edo9k / lorotas.py
Created September 19, 2016 19:51
Gera blocos de texto aleatório usando as tabelas de frases do Gerador de Lero Lero.
#!/usr/bin/env python3
#
# Frases retiradas do código original do Gerador de Lero-Lero
# Arquivado no Web Archive em:
# http://web.archive.org/web/20070320131106/http://www.suicidiovirtual.net/dados/lerolero.html
#
import random