Skip to content

Instantly share code, notes, and snippets.

View girol's full-sized avatar
🐍

André Girol girol

🐍
View GitHub Profile
@girol
girol / htacces_redirect
Created September 12, 2017 20:44
Apache htaccess http 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 September 6, 2017 20:52
PHP 301 HTTP Redirect
<?php
// Sets the http header to 301 - Good for search engines
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://mynewwebsite.com");
exit();
@girol
girol / random_color.js
Created April 28, 2017 20:12
Gerando cores aleatórias com JavaScript
// 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)];
}