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 / .bashrc
Created February 21, 2017 17:16
Animated Custom PS1 (terminal line)
Gre='\e[0;32m'; # green
Cya='\e[0;36m'; # cyan
Yel='\e[0;33m'; # yellow
Red='\e[0;31m'; # red
NC='\e[0m'; # No Color
PS1="\`if [ \$? = 0 ]; then printf \${Gre}\(\ノ\^\∇\^\)\${NC}; else echo \[\e[31m\]\(\╯\°\□\°\)\╯\︵ \┻\━\┻\[\e[0m\]; fi;\` ${Cya}\u ${Red}@ ${Cya}\h ${Gre}\w${Yel}\`__git_ps1\`${NC}\n\$ ";
@carlohcs
carlohcs / ssl-info.sh
Created February 21, 2017 03:10
[HEROKU] Informações de certificado de um app
heroku certs:info --app missaopessoal
@carlohcs
carlohcs / update.sh
Created February 21, 2017 02:56
[HEROKU] Atualização de certificado SSL
heroku certs:update /etc/letsencrypt/live/missaopessoal.com.br/cert.pem /etc/letsencrypt/live/missaopessoal.com.br/privkey.pem --app missaopessoal
@carlohcs
carlohcs / node_wrapper.md
Created January 31, 2017 17:00 — forked from cstipkovic/node_wrapper.md
NodeJS wrapper for run locally using binary

NodeJS Wrapper - run binary locally

Node.js wrapper which will download and proxy to node locally. This allows you to automatically manage the installed version of node.

CONFIGURATION

NODEW_INSTALL_VERSION - an env variable to specify the version of node to install - Defaults to 4.4.7 NODEW_DIST_BASE_URL - an env variable to specify the binary download location - Defaults to NodeJS website

svn log | perl -l40pe 's/^-+/\n/'
@carlohcs
carlohcs / jekyll-and-liquid.md
Created January 16, 2017 17:30 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@carlohcs
carlohcs / apache_app.conf
Created January 14, 2017 12:47
Permite apache responder por pastas com .well-known (com .)
# Reconhecimento de arquivos ssl
<Directory /app/web/public/.well-known>
Options +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
@carlohcs
carlohcs / import-once-workaround.scss
Created January 11, 2017 21:35 — forked from paulwellnerbou/import-once-workaround.scss
Function for SASS/SCSS to avoid duplicate imports and redundant generated CSS. See http://paul.wellnerbou.de/2015/05/18/avoid-multiple-imports-of-the-same-scss-file-with-sass/ for more details.
/* If this function is imported, you can import scss files using:
@if not-imported("your-file") { @import "your-file"; }
*/
$imported-once-files: () !default;
@function not-imported($name) {
$imported-once-files: $imported-once-files !global;
$module_index: index($imported-once-files, $name);
@if (($module_index == null) or ($module_index == false)) {
@carlohcs
carlohcs / copia-chave-ssh-para-servidor.md
Last active January 5, 2017 16:31
Como copiar chave ssh para servidor
if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == "http") {
if(!headers_sent()) {
header("Status: 301 Moved Permanently");
header(sprintf(
'Location: https://%s%s',
$_SERVER['HTTP_HOST'],
$_SERVER['REQUEST_URI']
));
exit();
}