Skip to content

Instantly share code, notes, and snippets.

Avatar
🐍

André Girol girol

🐍
  • Brazil
View GitHub Profile
@girol
girol / app.py
Last active Mar 10, 2020
Python script SystemD example
View app.py
from time import sleep
import os
hi = os.environ.get('HELLO')
seconds = 1
while(True):
sleep(1)
print("logging...", seconds, "Env Var: ", hi)
@girol
girol / redirect.php
Created Sep 24, 2018
PHP 301 redirect
View redirect.php
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://my_url.com/my_folder");
exit();
@girol
girol / term_colors
Created Sep 11, 2018
Terminal Colors
View term_colors
default="\033[39m"
black="\033[30m"
red="\033[0;31m"
green="\033[32m"
yellow="\033[33m"
blue="\033[34m"
magenta="\033[35m"
cyan="\033[36m"
gray="\033[90m"
@girol
girol / vim_settings.json
Created Aug 18, 2018
Vim Settings for VSCode Vim Extension
View vim_settings.json
// Vim extension shortcuts status bar colors depending on vim mode
"vim.statusBarColorControl": true,
"vim.statusBarColors": {
"normal": ["#444444", "#FFFFFF"],
"insert": "#00005F",
"visual": "#FF5F00",
"visualline": "#5F0000",
"visualblock": "#006400",
"replace": "#FF0000"
@girol
girol / post-receive
Created Apr 20, 2018
Git Hook Composer Autoloader
View post-receive
#/bin/bash
export GIT_WORK_TREE=/folder/to/my/app # like /var/www
#export GIT_DIR=/my/repo.git
git checkout -f master
cd $GIT_WORK_TREE
composer dump-autoload
@girol
girol / .bashrc_ps1
Last active Aug 18, 2018
Custom Bash PS1
View .bashrc_ps1
# Hostname hardcoded for weird hosting names
# Generates a nice hostname for use in hosting services that creates random users and random nameservers
#
# Helps to track whare you are logged in when using ssh
#
# Generated with: http://ezprompt.net/
export PS1="\[\e[36m\]hostname\[\e[m\]:\W\[\e[34m\] \$\[\e[m\] "
View vscode_settings.json
{
"workbench.colorTheme": "Hackerman",
"files.trimTrailingWhitespace": true,
"workbench.colorCustomizations": {
"editor.background": "#000",
"editorRuler.foreground": "#08ae6e95",
"statusBar.background": "#000",
},
"terminal.integrated.fontSize": 14,
"window.zoomLevel": 1,
@girol
girol / .gitconfig
Last active Aug 23, 2018
My gitconfiguration
View .gitconfig
[user]
name = André Luiz Girol
email = andregirol@gmail.com
[core]
editor = vim
[color]
ui = true
[color "status"]
added = green bold
changed = yellow
@girol
girol / htacces_redirect
Created Sep 12, 2017
Apache htaccess http redirect
View htacces_redirect
# Change as you need
# Rename this file to .htaccess and put into your website's DocumentRoot folder.
# It needs Rewrite module enabled in your system
# Other HTTP status codes works as well, as 302, and so on...
Redirect 301 /some_folder http://my_redirected_website.org
@girol
girol / redirect.php
Created Sep 6, 2017
PHP 301 HTTP Redirect
View redirect.php
<?php
// Sets the http header to 301 - Good for search engines
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://mynewwebsite.com");
exit();