Skip to content

Instantly share code, notes, and snippets.

View h3nr1ke's full-sized avatar
🤔
Should I?

H3NR1KE h3nr1ke

🤔
Should I?
View GitHub Profile
@h3nr1ke
h3nr1ke / colored_bash.profile
Last active May 23, 2018 22:02
Lines to let your terminal on max os use theme colors all the time
#add this content to your .bash_profile file
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
#create a new file called darkside.terminal and add the following content
<?xml version="1.0" encoding="UTF-8"?>
@h3nr1ke
h3nr1ke / computer_name.sh
Created February 15, 2018 02:04
Change Computer name on mac OS
#if you have, for instance
# root@NAMETHATYOUDONTLIKE : ~
#you can use the following command
sudo scutil --set HostName name-you-want
#to change it
# root@COOLNAMETHATILIKE : ~
@h3nr1ke
h3nr1ke / package.json
Last active February 15, 2018 10:55
Package.json
{
"name": "teste_api",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
@h3nr1ke
h3nr1ke / cards.spec.js
Last active April 15, 2019 18:29
Arquivo exemplo de teste automático, projeto no github https://github.com/h3nr1ke/teste_api
/**
* Arquivo exemplo para teste de api
* A API utilizada neste projeto eh
* @see https://magicthegathering.io/
*
* Este exemplo faz parte de um post no medium
* @see https://medium.com/@hdeodato/teste-autom%C3%A1tico-de-api-rest-usando-com-node-js-mocha-chai-6aec4613d100
*
* @author Henrique Deodato
* @see twitter.com/hdeodato
@h3nr1ke
h3nr1ke / resultado.sh
Created February 15, 2018 12:39
resultado do teste autoático da URL
$ mocha
Teste API magicthegathering.io
√ Deve receber 100 cartas (1468ms)
√ Deve receber a carta 'A Indiferente' (351ms)
2 passing (2s)
@h3nr1ke
h3nr1ke / resultado-falha.sh
Created February 15, 2018 12:40
resultado do teste automático com falha
$ mocha
Teste API magicthegathering.io
1) Deve receber 100 cartas
√ Deve receber a carta 'A Indiferente' (414ms)
1 passing (2s)
1 failing
@h3nr1ke
h3nr1ke / compress_command_line.sh
Created February 15, 2018 17:32
Install and use compress tool ubuntu
#install
sudo apt-get install yui-compressor
#to use, js and css files only
yui-compressor /path/to/file -o /path/to/new/file
@h3nr1ke
h3nr1ke / fix_android_err_spawn.sh
Created February 21, 2018 10:13
Fix Error: spawn EACCES when running cordova build android
# run it from your project folder
# based on this link
# https://github.com/ionic-team/ionic-cli/issues/2835
# erroroccurs when run...
cordova build android
# ANDROID_HOME=/usr/local/Caskroom/android-platform-tools/27.0.1
# JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
# Error: spawn EACCES
@h3nr1ke
h3nr1ke / certbot.sh
Last active March 26, 2018 22:17
certbot error...
#---- renew ssl when you get the error
#---- Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.
certbot --authenticator standalone --installer apache -d <domain> --pre-hook "systemctl stop apache2" --post-hook "systemctl start apache2"
@h3nr1ke
h3nr1ke / nginx_tips.txt
Created May 2, 2018 00:48
Useful tips for nginx configuration
# -- UBUNTU + PHP7 + NGINX
# -- must add it to you pgp location
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; #replace if already there...
# -- must to check the listen path to php fpm sock is this file
nano /etc/php/7.0/fpm/pool.d/www.conf
# -- search for "listen = ", this path must be
/var/run/php/php7.0-fpm.sock