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
# Add scripts to /usr/bin | |
ln -s /srv/www/website/tasks/website-backup-applications.sh /usr/bin/website-backup-applications | |
ln -s /srv/www/website/tasks/website-backup-database.sh /usr/bin/website-backup-database | |
ln -s /srv/www/website/tasks/website-full-backup.sh /usr/bin/website-full-backup | |
ln -s /srv/www/website/tasks/website-switch.sh /usr/bin/website-switch |
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
jQuery( document ).ready( function( $ ) { | |
var scrollable = $('#branding .navbar-inner'); | |
var difference = 5; | |
if ( scrollable.length ) { | |
var a = document.body; | |
var e = document.documentElement; | |
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 -e "\e[32m"; | |
while :; do for i in {1..16}; | |
do r="$(($RANDOM % 2))"; | |
if [[ $(($RANDOM % 5)) == 1 ]]; then | |
if [[ $(($RANDOM % 4)) == 1 ]]; then | |
v+="\e[1m $r "; | |
else | |
v+="\e[2m $r "; | |
fi; | |
else |
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
################### | |
# Compress a folder | |
################### | |
tar czfv test.tar.gz test/ | |
# "czfv" stands for "Compress Zip File Verbose" | |
# If you want bzip files, use "j" instead of "z". | |
################### | |
# Uncompress a file | |
################### |
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
# Create ssh directory if it doesn't exist | |
mkdir -p ~/.ssh | |
# Go to ssh directory | |
cd !$ | |
# Create public and private keys | |
ssh-keygen | |
# Upload your publick key to some server | |
cat ~/.ssh/id_rsa.pub | ssh user@host -p 22 "cat - >> ~/.ssh/authorized_keys" |
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 | |
# | |
# vvv-init-setup-plugins-post.sh | |
# | |
# This file will perform some additional tasks on installed plugins. | |
# Get Peasant from https://github.com/andrezrv/peasant-vvv-provider. | |
# Include config file. | |
this_dir="$(dirname `readlink -f $(dirname $0)/vvv-init.sh`)" | |
. "${this_dir}/config.sh" |
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
config.vm.provider :virtualbox do |v| | |
v.customize ["modifyvm", :id, "--memory", "3072"] | |
v.customize ["modifyvm", :id, "--cpus", "4"] | |
v.customize ["modifyvm", :id, "--ioapic", "on"] | |
end |
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
jQuery( document ).ready( function( $ ) { | |
$.fn.animate_number = function( options ) { | |
options.fromNumber = options.fromNumber ? options.fromNumber : 0; | |
options.toNumber = options.toNumber ? options.toNumber : 0; | |
options.rounding = options.rounding ? options.rounding : 0; | |
options.thousands = options.thousands ? options.thousands : ''; | |
options.decimals = options.decimals ? options.decimals : '.'; | |
options.element = this; |
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 | |
/* | |
Plugin name: Local Plugins | |
Description: A loader for plugins that should run only in local stages. | |
Author: Andrés Villarreal | |
Author URI: http://about.me/andrezrv | |
Version: 1.0 | |
License: GPL2 | |
*/ | |
function local_plugins_setup() { |
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 | |
/** | |
* Avoid sending mails when working locally. | |
*/ | |
if ( ! function_exists( 'wp_mail' ) | |
&& defined( 'WP_STAGE' ) | |
&& 'local' == WP_STAGE | |
&& ( ! defined( 'WP_MAIL_LOCAL' ) || true !== WP_MAIL_LOCAL ) | |
) { | |
function wp_mail( $to, $subject, $message, $headers = '' ) { |