Skip to content

Instantly share code, notes, and snippets.

/**
* Data on today, yesterday, and the current month.
*/
$date = new DateTime();
$filter['todayText'] = $date->format('l');
$filter['monthText'] = $date->format('F');
$date->modify('yesterday');
$filter['yesterdayText'] = $date->format('l');
@caseyw
caseyw / mac_php56_setup_guide
Created November 16, 2015 14:16
Few commands to get local mac up to development standards
$ xcode-select --install
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew tap homebrew/dupes
$ brew tap homebrew/versions
$ brew tap homebrew/homebrew-php
$ brew install php56
@caseyw
caseyw / pagespeed_checker.php
Created August 4, 2015 15:29
Look through list of domains to see if PageSpeed service is enabled
#!/usr/bin/env php
<?php
/**
* List of domains on the level where your CNAME would exist
*/
$domains = [
];
echo PHP_EOL;
@caseyw
caseyw / file.js
Created September 12, 2014 22:22
var x = document.createElement('script');
x.src = '/javascripts/prototype.js';
document.getElementsByTagName("head")[0].appendChild(x);
var x = document.createElement('script');
x.src = '/javascripts/jquery.js';
document.getElementsByTagName("head")[0].appendChild(x);
var x = document.createElement('script');
x.src = '/javascripts/jquery_ui.js';
Walk all commits back to a certain commit
git revert --no-commit 0766c053..HEAD
git commit
Comment from author (Yarin):
# Die Supervisor processes that didn't get taken down by your guardian!!
ps -ef | grep gearman | grep -v grep | awk '{print $2}' | xargs kill -9
@caseyw
caseyw / vagrant_error
Created August 25, 2014 13:11
Vagrant Error
Error:
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:
mount -t vboxsf -o uid=`id -u root`,gid=`getent group vagrant | cut -d: -f3` tmp_vagrant-puppet-3_manifests /tmp/vagrant-puppet-3/manifests
mount -t vboxsf -o uid=`id -u root`,gid=`id -g vagrant` tmp_vagrant-puppet-3_manifests /tmp/vagrant-puppet-3/manifests
# Aliases
alias vup="vagrant up"
alias vh="vagrant halt"
alias vs="vagrant suspend"
alias vr="vagrant resume"
alias vrl="vagrant reload"
alias vssh="vagrant ssh"
alias vst="vagrant status"
alias vp="vagrant provision"
alias vdstr="vagrant destroy"
// Find the third td of each tr and see if the IP starts with X, if so lets check the box for removal
$("table.ACCtable2 tr td:nth-child(3)").each(function() {
$ipNode = $(this);
if ($ipNode.text().indexOf(' XXX.XXX.XXX.') >= 0) {
$ipNode.prev().prev().children('input').prop('checked', true);
}
});
Reset Root Mysql on Ubuntu
sudo dpkg-reconfigure mysql-server-5.1