Skip to content

Instantly share code, notes, and snippets.

View carlohcs's full-sized avatar
🎯
Focusing on my Postgraduate degree!

Carlos Santana carlohcs

🎯
Focusing on my Postgraduate degree!
View GitHub Profile
@carlohcs
carlohcs / ava-package.json
Created May 24, 2018 20:46
AVA-test-suite
"test": "nyc ava --verbose",
"test:suite": "nyc ava --tap | tap-spec",
"test:watch": "ava --verbose --watch",
"report": "nyc report --reporter=html",
"test-report": "nyc ava && nyc report --reporter=html",
@carlohcs
carlohcs / update-branches-local-git.sh
Created May 17, 2018 18:25
Sincroniza branches remotas para local
# SINCRONIZA AS BRANCHES REMOTAS PARA LOCAL
for remote in `git branch -r `; do git branch --track $remote; done
git remote update
git pull --all
@carlohcs
carlohcs / retoreBashOriginalFile.sh
Created March 17, 2018 14:50
restore bash original file
cp /etc/skel/.bashrc ~/
@carlohcs
carlohcs / loading-example.js
Created January 31, 2018 17:57
Exemplo de loading state com Promises
// Método Ajax
function getData(){
$promise = $.Deferred();
setTimeout(function(){
$promise.resolve();
}, 3000);
return $promise.promise;
}
@carlohcs
carlohcs / find-port.sh
Created January 22, 2018 15:21
Encontrar processo que está utilizando a porta
sudo netstat -nlp|grep 4000
@carlohcs
carlohcs / saveFilesWGET.sh
Created November 28, 2017 17:07
Salva vários arquivos do servidor de forma sequêncial
wget http://someaddress.com/logs/dbsclog01s{001..050}.log
@carlohcs
carlohcs / consoleSaveChrome.js
Created November 13, 2017 17:56
Adiciona console.save ao Google Chrome
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
@carlohcs
carlohcs / nodeStop.js
Created October 20, 2017 21:14
Matar algum processo via node
killall -9 node
require('child_process').exec(`kill -9 ${pid}`)
// Base: https://gist.github.com/dominhhai/aa7f3314ad27e2c50fd5
@carlohcs
carlohcs / slack_invite_all.js
Created May 4, 2017 18:52
[Slack] Invite all people to a channel
//https://webapps.stackexchange.com/questions/100820/how-do-i-invite-all-team-members-to-a-new-slack-channel
var foundAny=false;
function selectAllByLetter(remainingLetters) {
console.log(remainingLetters)
var letter = remainingLetters.pop();
$("#channel_invite_filter").val(letter).trigger("input");
setTimeout(function() {
$(".channel_invite_member:not(hidden)").each(function(i, obj) {
foundAny=true;