Skip to content

Instantly share code, notes, and snippets.

View marlonassuncao's full-sized avatar

Marlon Assunção marlonassuncao

View GitHub Profile
@marlonassuncao
marlonassuncao / gist:e77cc3d602658b04b751
Last active August 28, 2015 17:13
“use strict”, qual sua utilidade? | Exemplo: 2
function minhaIdade() {
"use strict";
idade = 25;
// ...
}
minhaIdade();
@marlonassuncao
marlonassuncao / gist:9b701e718c4c5ec8541d
Last active August 28, 2015 17:14
“use strict”, qual sua utilidade? | Exemplo: 3
function minhaIdade() {
var idade = 25;
// ...
}
minhaIdade();
@marlonassuncao
marlonassuncao / change_root.sh
Last active August 29, 2015 14:10
Change domain root folder on cPanel.
# Open config by user.
sudo nano /var/cpanel/userdata/USERNAME/DOMAINNAME.COM
# Change root directory.
documentroot: /home/USERNAME/public_html/NEW_PATH
# Rebuild and restart server.
/scripts/rebuildhttpdconf
service httpd restart
@marlonassuncao
marlonassuncao / permission_user.sh
Last active August 29, 2015 14:13
Give permission to a cpanel ftp user.
sudo chown -R user:user /folder/*
@marlonassuncao
marlonassuncao / remove_homebrew.sh
Last active August 29, 2015 14:17
Remove homebrew completely.
cd `brew --prefix`
rm -rf Cellar
brew prune
rm `git ls-files`
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
rm -rf .git
rm -rf ~/Library/Caches/Homebrew
@marlonassuncao
marlonassuncao / clearfix.styl
Last active August 29, 2015 14:17
Stylus clearfix hack.
clearfix()
*zoom 1
&:before
&:after
content ''
display table
&:after
clear both
@marlonassuncao
marlonassuncao / zip.sh
Created April 2, 2015 14:36
Compress all folder to .zip on linux.
zip -r myfiles.zip myfiles
@marlonassuncao
marlonassuncao / sendMail.php
Created June 19, 2015 16:47
Sendmail SMTP with class PHPmailer.
<?php
require 'vendor/PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer;
// $mail->SMTPDebug = 3; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp1.example.com;smtp2.example.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
@marlonassuncao
marlonassuncao / gist:fc36d2f6a9f2839fb906
Last active August 29, 2015 14:25
“use strict”, qual sua utilidade? | Exemplo: 1
function minhaIdade() {
idade = 25;
// ...
}
minhaIdade();
@marlonassuncao
marlonassuncao / utf8.sql
Last active December 11, 2015 12:59
Alterar charset mysql
ALTER TABLE $table CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci