Skip to content

Instantly share code, notes, and snippets.

View mfurquimdev's full-sized avatar
🐧

Mateus Furquim mfurquimdev

🐧
View GitHub Profile
set nocompatible " be iMproved, required
filetype off " required
" Remove all autocmds
autocmd!
let $VIM='~/.vim/'
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Plugin stuff
all:
pdflatex journal.tex
rm -rf *.aux *.log
clean:
rm -rf *.pdf
@mfurquimdev
mfurquimdev / consistent_hashring.go
Last active August 4, 2019 02:10
Testing hashring function with and without hash.
package main
import (
"crypto/sha512"
"fmt"
"github.com/serialx/hashring"
"math/rand"
"time"
)
export CLICOLORS=1
export LSCOLORS=gxfxbxdxcxGxDxExFxHxCx
export LS_COLORS="di=36:ln=35:so=31:pi=33:ex=32:bd=1;36:cd=1;33:su=1;34:sg=1;35:tw=1;37:ow=1;32"
export GREP_OPTIONS='--color=auto'
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
return
fi
# Make bash check its window size after a process completes
shopt -s histappend
shopt -s checkwinsize
bind 'set show-all-if-ambiguous off'
bind 'set completion-ignore-case on'
@mfurquimdev
mfurquimdev / OF.sh
Created June 24, 2019 15:27
Script para auxiliar nas OFs
#!/bin/bash
if [ $# != 1 ];
then
echo "Usage: $0 \"Author Name\"";
exit 1;
fi;
remote=$(git remote -v | cut -f 2 | cut -f 1-4 -d "." | head -1);
for c in $(git log --since="1 month ago" --oneline --author="$1" | cut -f1 -d " ");
@mfurquimdev
mfurquimdev / mapping.py
Created April 2, 2019 19:52
Mapping a range of values to another
# https://github.com/arduino/Arduino/issues/2466
def m (x, in_min, in_max, out_min, out_max):
if ((in_max - in_min) > (out_max - out_min)):
return (x - in_min) * (out_max - out_min+1) / (in_max - in_min+1) + out_min;
else:
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
@mfurquimdev
mfurquimdev / friday.sh
Last active March 22, 2019 15:46
Script to calculate what time you can leave work on friday #Sextou
#!/bin/bash
if [ $# -ne 2 ]; then
echo "usage: $0 <9 or 11> <CSV_FILE>"
exit 1
fi
iconv -c -f utf8 -t ISO-8859-1 "$2" > iso.csv
# Calculating hours
@mfurquimdev
mfurquimdev / gist:0e7018a4df491e17c731d9e16e3fb00c
Created February 14, 2019 16:57
Delete everything related to docker
docker rmi -f $(docker image ls -q); docker rm $(docker ps -aq); docker volume rm -f $(docker volume ls -q);
@mfurquimdev
mfurquimdev / while_loop.sh
Created October 9, 2018 03:28
Doing loop in bash script
i=1; while [ $i -le 3 ]; do echo $i; i=$((i+1)); done