This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set-option -g default-terminal screen-256color | |
set-option -g bell-action any | |
set-option -g history-limit 500000 | |
set-option -g base-index 1 | |
set-option -g xterm-keys on | |
set-option -s escape-time 10 | |
set-window-option -g monitor-activity on | |
set-window-option -g pane-base-index 1 | |
# Mapeamento de teclas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ag "$1" --jade --vimgrep | cut -f1,2 -d: | awk -F: '{ print "git blame -L"$2",-1 --show-name -- " $1 }' | sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:8.5.0 | |
# Isso vai te ajudar a lidar com os signais tipo SIGKILL | |
RUN wget https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb | |
RUN dpkg -i dumb-init_*.deb | |
ENTRYPOINT ["dumb-init"] | |
# Google Chrome | |
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - | |
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Bulk replace for MAC | |
# ag <https://github.com/ggreer/the_silver_searcher> | |
# original idea: https://gist.github.com/hlissner/db74d23fc00bed81ff62 | |
# usage: replace [search] [replace] | |
function replace { | |
ag -0 -l "$1" | xargs -0 sed -i "" -E "s/$1/$2/g" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function infinite(fn, ...args) { | |
function partial(...args2) { | |
return infinite(fn, ...args.concat(args2)); | |
} | |
partial.result = () => { | |
return fn(...args); | |
}; | |
return partial; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const matrix = [ | |
[ 0,0,1,0,1], | |
[ 1,1,0,1,1], | |
[ 0,1,0,1,0 ], | |
[ 0,1,1,1,1 ], | |
[ 1,0,1,0,1 ], | |
] | |
function checkZero (index_x, index_y, check) { | |
const temp = matrix[index_x] || [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const str = 'Ola como vai <b>voce?\n Eu vou</b> <b>bem</b>' | |
str.replace(/<b>(.*?|[\s\S]*?)<\/b>/g, '**$1**') | |
// Result: "Ola como vai **voce?\n Eu vou** **bem**" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The MIT License (MIT) | |
# | |
# Copyright (c) 2018 RatoX | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of | |
# this software and associated documentation files (the "Software"), to deal in | |
# the Software without restriction, including without limitation the rights to | |
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
# the Software, and to permit persons to whom the Software is furnished to do so, | |
# subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First you need to install gcalcli please go to https://github.com/insanum/gcalcli | |
wg_next_event="#(gcalcli --military --nostarted agenda --nocolor | cut -d ' ' -f 2- | head -2 | tail -1 | cut -c1-40)" | |
set -g status-right "#[fg=colour15,bg=colour237,bold]📅 $wg_next_event" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This is in progress I tested it only on macOS 10.13.6 | |
# outuput e.g: | |
# PID (319) Spotify -> :57621 | |
function ports { | |
PORTS=$(lsof -iTCP -sTCP:LISTEN -nP) | |
echo "$PORTS" | awk 'match($9, /[\]|\*]+:(.*)$/) { print " PID ("$2") "$1" -> "substr($9, RSTART+1, RLENGTH-1) }' | |
} |
OlderNewer