This file contains hidden or 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 | |
# Create ftp user, create folders and set permissions | |
# Shamelessly coppied from http://dev.n0ise.net/2012/09/vsftpd-add-user-automation-bash-script/ | |
# Usage: ./create_ftp_user.sh [username] "[password]" | |
# | |
NAME=$1 | |
PASS=$2 |
This file contains hidden or 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
echo "My test email being sent from sendmail" | /usr/sbin/sendmail [email protected] |
This file contains hidden or 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
#!/usr/bin/env bash | |
# Add repo for latest PHP | |
sudo add-apt-repository -y ppa:ondrej/php5 | |
# Update Again | |
sudo apt-get update | |
# Install PHP | |
sudo apt-get install -y php5-cli php5-mysql php5-pgsql php5-sqlite php5-curl php5-gd php5-mcrypt php5-xdebug php5-memcached |
This file contains hidden or 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
#!/usr/bin/env bash | |
echo ">>> Setting MySQL Permissions" | |
[[ -z "$1" ]] && { echo "!!! MySQL root password not set. Check the Vagrant file."; exit 1; } | |
sudo sed -i '/^bind-address/s/bind-address.*=.*/bind-address = 0.0.0.0/' /etc/mysql/my.cnf | |
mysql -u root -p$1 -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '$1' WITH GRANT OPTION; FLUSH PRIVILEGES;" | |
sudo service mysql restart |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
# laravel new-app | |
alias laravel="git clone -o laravel -b develop https://github.com/laravel/laravel.git" | |
alias artisan="php artisan" | |
alias migrate="php artisan migrate" | |
alias serve="php artisan serve" | |
alias dump="php artisan dump" | |
alias t="phpunit" | |
# Generators Package |
This file contains hidden or 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
UPDATE my_table | |
SET my_field = REPLACE(my_field, 'old-string', 'new-string') | |
WHERE my_field LIKE '%old-string%' |
This file contains hidden or 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
.email { | |
unicode-bidi: bidi-override; | |
direction: rtl; | |
text-align: left; | |
} |
This file contains hidden or 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 | |
echo '<pre>'; | |
for($i = 100;$i>=0;$i--){ | |
print $i; | |
if($i % 2 === 0) { | |
print " is even"; | |
if($i % 12 === 0) printf(" and is %d dozen",$i/12); | |
} | |
else print " is odd"; | |
print ".\n"; |
This file contains hidden or 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
$_SERVER['HTTP_X_REQUESTED_WITH'] == 'xmlhttprequest' |
NewerOlder