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
$(document).ready(function() { | |
$('div').on('transitionend MSTransitionEnd webkitTransitionEnd oTransitionEnd', function(event) { | |
// Do stuff after transition | |
}); | |
}); |
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
# See: http://ubuntuforums.org/showthread.php?t=261366 | |
# Make list of installed software. | |
dpkg --get-selections > installed-software | |
# Install software on another machine. | |
dpkg --set-selections < installed-software | |
sudo apt-get install dselect | |
dselect |
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
# Clear Ubuntu image network rules before cloning. | |
sudo rm /etc/udev/rules.d/70-persistent-net.rules | |
# Clone a VirtualBox disk image. | |
VBoxManage clonehd /path/to/original.vdi /path/to/clone.vdi |
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
# /path/to/repository/.hg/hgrc | |
# $ hg push staging | |
# $ hg push live | |
[paths] | |
live = ssh://<username>@<server>//var/www/vhosts/<live-website> | |
staging = ssh://<username>@<server>//var/www/vhosts/<staging-website> | |
[hooks] | |
changegroup = hg update |
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 | |
trait MetaClass | |
{ | |
protected $__classMethods = array(); | |
static protected $__staticMethods = array(); | |
public function __call($name, $args) | |
{ |
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
# Install XCode. | |
# Install XCode CLI Tools. | |
# Select XCode. | |
xcode-select -switch /Applications/Xcode.app/Contents/Developer | |
# Install Auto Tools. | |
brew install autoconf automake | |
# Symlink iOS Simulator. |
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
# Install Dependencies | |
# sudo apt-get install build-essential | |
# sudo apt-get build-dep php5 | |
sudo apt-get install libmysqlclient-dev mysql-client libcurl4-openssl-dev libgd2-xpm-dev libjpeg-dev libpng3-dev libxpm-dev libfreetype6-dev libt1-dev libmcrypt-dev libxslt1-dev bzip2 libbz2-dev libxml2-dev libevent-dev libltdl-dev libmagickwand-dev libmagickcore-dev imagemagick libreadline-dev libc-client-dev libsnmp-dev snmpd snmp libvpx-dev libxpm-dev libgmp3-dev libicu-dev libpspell-dev libtidy-dev freetds-dev unixodbc-dev librecode-dev libglib2.0-dev libsasl2-dev libgeoip-dev imagemagick libmagickcore-dev libmagickwand-dev | |
# Stop Apache | |
sudo service apache2 stop | |
# Cleanup Packages | |
sudo apt-get autoremove |
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 | |
// Comparison and Formatting | |
$start = new DateTime('now'); | |
$end = new DateTime('2014-02-01'); | |
echo 'Start: ' . $start->format('d M Y') . "\n"; | |
echo 'End: ' . $end->format('d M Y') . "\n"; | |
$diff = $end->diff($start); | |
echo 'Comparison: ' . ($start < $end ? 'Start is less than End' : 'End is less than Start') . "\n"; |
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 | |
class BCrypt | |
{ | |
/** | |
* Work factor cost boundaries and default. | |
* | |
* @var const | |
*/ | |
const COST_MIN = 4; | |
const COST_MAX = 31; |
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 | |
/** | |
* Todo: Send a random user agent string and sleep a random amount between requests. | |
*/ | |
if ($_SERVER['REQUEST_METHOD'] == 'POST') { | |
// Extract and sanatize input: | |
$domain = filter_input(INPUT_POST, 'domain', FILTER_SANITIZE_URL); | |
$terms = filter_input(INPUT_POST, 'terms', FILTER_SANITIZE_STRING); | |
// Setup Goutte (which also includes Guzzle): |