Skip to content

Instantly share code, notes, and snippets.

@rod-stuchi
rod-stuchi / svg2android-assets.sh
Created August 9, 2016 08:51
Convert SVGs to Android drawable-[*dpi]
#!/bin/bash
rm -rf ./pngs
mkdir -p ./pngs/drawable-ldpi
mkdir -p ./pngs/drawable-mdpi
mkdir -p ./pngs/drawable-hdpi
mkdir -p ./pngs/drawable-xhdpi
mkdir -p ./pngs/drawable-xxhdpi
mkdir -p ./pngs/drawable-xxxhdpi
@rod-stuchi
rod-stuchi / 0_reuse_code.js
Created September 30, 2016 01:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@rod-stuchi
rod-stuchi / CPF.CPNJ_Generator.js
Last active September 30, 2016 03:21
Gerador CPF e CNPJ em Javascript
//es2015 syntaxe
console.clear();
String.prototype.repeat = String.prototype.repeat || function(n){
return n<=1 ? this : (this + this.repeat(n-1));
}
String.prototype.padLeft = function(char, length) {
return char.repeat(Math.max(0, length - this.length)) + this;
@rod-stuchi
rod-stuchi / pacaur_install.sh
Created August 14, 2017 12:00 — forked from tadly/pacaur_install.sh
A simple shell script to quickly / easily install "pacaur" on archlinux
#!/bin/sh
# If you are new to arch, I encourage you to at least read and understand what
# this script does befor blindley running it.
# That's why I didn't make a one-liner out of it so you have an easier time
# reading and understanding it :)
#
# This scripts purpose is purly to save you a few seconds on your new installation.
#
# Enjoy your time on an awesome system. Arch FTW!
@rod-stuchi
rod-stuchi / .gitconfig
Created August 24, 2017 12:56 — forked from huytd/.gitconfig
Use neovim as diff tool
[merge]
tool = vimdiff
[mergetool]
prompt = true
[mergetool "vimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[difftool]
prompt = false
[diff]
tool = vimdiff
@rod-stuchi
rod-stuchi / TrueColour.md
Created December 31, 2017 19:38 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
@rod-stuchi
rod-stuchi / .zshrc
Created April 2, 2018 02:11 — forked from SlexAxton/.zshrc
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@rod-stuchi
rod-stuchi / my.cnf
Last active July 31, 2018 14:39
Configure pager in MySQL no break mysqldump
# /etc/my.cnf
# https://stackoverflow.com/questions/924729/how-to-best-display-in-terminal-a-mysql-select-returning-too-many-fields
[client]:
default-character-set=utf8
#http://bargablog.blogspot.com/2016/01/mysql-pager-setting-in-mycnf.html
[mysql]
pager=less -SFX