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-vscode.json
Created May 25, 2018 19:20
Runing ava in VSCODE
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run Ava Tests",
@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