This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gera uma cor aleatória em hexadecimal | |
function gera_cor(){ | |
var hexadecimais = '0123456789ABCDEF'; | |
var cor = '#'; | |
// Pega um número aleatório no array acima | |
for (var i = 0; i < 6; i++ ) { | |
//E concatena à variável cor | |
cor += hexadecimais[Math.floor(Math.random() * 16)]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Sets the http header to 301 - Good for search engines | |
header("HTTP/1.1 301 Moved Permanently"); | |
header("Location: http://mynewwebsite.com"); | |
exit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"workbench.colorTheme": "Hackerman", | |
"files.trimTrailingWhitespace": true, | |
"workbench.colorCustomizations": { | |
"editor.background": "#000", | |
"editorRuler.foreground": "#08ae6e95", | |
"statusBar.background": "#000", | |
}, | |
"terminal.integrated.fontSize": 14, | |
"window.zoomLevel": 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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\] " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
import os | |
hi = os.environ.get('HELLO') | |
seconds = 1 | |
while(True): | |
sleep(1) | |
print("logging...", seconds, "Env Var: ", hi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nginx:alpine | |
COPY index.html /usr/share/nginx/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"if": { | |
"prefix": "if", | |
"body": [ | |
"if ${1:expression}:", | |
"\t${2:pass}" | |
], | |
"description": "Code snippet for an if statement" | |
}, | |
"if/else": { |
OlderNewer