Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
check host mongodb with address localhost | |
start program = "/usr/bin/sudo /opt/database/mongo/bin/mongod" | |
stop program = "/usr/bin/sudo /usr/bin/pkill -f mongod" | |
if failed port 28017 protocol HTTP | |
request / | |
with timeout 10 seconds | |
then start |
sub, sup { | |
/* Specified in % so that the sup/sup is the | |
right size relative to the surrounding text */ | |
font-size: 75%; | |
/* Zero out the line-height so that it doesn't | |
interfere with the positioning that follows */ | |
line-height: 0; | |
/* Where the magic happens: makes all browsers position |
var _0x100000000000000 = 0x100000000000000, | |
_0x1000000000000 = 0x1000000000000, | |
_0x10000000000 = 0x10000000000, | |
_0x100000000 = 0x100000000, | |
_0x1000000 = 0x1000000, | |
_0x10000 = 0x10000, | |
_0x100 = 0x100, | |
_0xff = 0xff, | |
_0x80 = 0x80; |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
brew update | |
brew versions FORMULA | |
cd `brew --prefix` | |
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions" | |
brew install FORMULA | |
brew switch FORMULA VERSION | |
git checkout -- Library/Formula/FORMULA.rb # reset formula | |
## Example: Using Subversion 1.6.17 | |
# |
<?php | |
class DateFormat { | |
const DATE_SHORT = 'Y-m-d'; | |
const DATE_LONG = 'F j, Y'; | |
const DATETIME_SHORT = 'Y-m-d H:i'; | |
const DATETIME_LONG = 'F j, Y, g:i a'; |
# the admin password for all of the IE VMs is “Password1″ without the quotes, it's also used for the password hints | |
1) Install VirtuaBox on your mac | |
http://download.virtualbox.org/virtualbox/4.1.10/VirtualBox-4.1.10-76795-OSX.dmg | |
2) Decide which versions of Internet Explorer you want to download and install – each version of Internet Explorer is contained within a separate virtual machine that runs within VirtualBox. In other words, if you want to run Internet Explorer 7, 8, and 9, you will need to download three separate VM’s, which may take a while so keep that in mind. Select the text below and copy it: | |
# Install ALL versions of Internet Explorer: IE 7, IE 8, and IE 9 (for now this script will also pull down a IE 6 vm with windows xp) |
jQuery.fn.shake = function(intShakes, intDistance, intDuration) { | |
this.each(function() { | |
$(this).css({ | |
position: "relative" | |
}); | |
for (var x = 1; x <= intShakes; x++) { | |
$(this).animate({ | |
left: (intDistance * -1) | |
}, (((intDuration / intShakes) / 4))).animate({ | |
left: intDistance |
check process redis-server | |
with pidfile "/var/run/redis.pid" | |
start program = "/etc/init.d/redis-server start" | |
stop program = "/etc/init.d/redis-server stop" | |
if 2 restarts within 3 cycles then timeout | |
if totalmem > 100 Mb then alert | |
if children > 255 for 5 cycles then stop | |
if cpu usage > 95% for 3 cycles then restart | |
if failed host 127.0.0.1 port 6379 then restart | |
if 5 restarts within 5 cycles then timeout |