Skip to content

Instantly share code, notes, and snippets.

View edo9k's full-sized avatar
🪲

Eduardo França edo9k

🪲
View GitHub Profile
@edo9k
edo9k / crop_file_names.sh
Last active September 12, 2016 12:00
Bash one liner to crop all file names in one directory to the length specified in the 'cut' command. (This is done the hard & dumb way here, I'm pretty sure rename can do it better with the proper regex. I can't regex very that well.)
for i in $files; do echo "mv $i $(echo $i | cut -c 1-8)"; done
@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
@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 / 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 / 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 / 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 / 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 / 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 / speak
Last active May 30, 2019 21:08
Gets text from clipboard and reads in the detected language (using the espeak tts system).
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# speak.py
#
# Copyleft 2016 Eduardo França <@edo9k>
#
# to install
# $ sudo apt install python-pip
# $ pip install future langdetect pyperclip sh
@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,