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
/** | |
* A module for loading scripts asynchronously in most browsers. | |
* | |
* Note: this module uses the script.async attribute (see line 30), which | |
* tells the browser to load the script asynchronously. Most modern browsers | |
* support this async functionality, but those that don't will simply | |
* overlook it without causing problems. | |
* | |
* In addition, older versions of IE, Webkit, and Firefox 4+ that don't | |
* support the async attribute will still load scripts asynchronously |
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 | |
/** | |
* If you call this with "$ php standard-in-out-error.php", | |
* it will print output and error messages to the command line. | |
* | |
* To pipe just the error messages into their own file, | |
* use "$ php standard-in-out-error.php 2> error.log" | |
*/ |
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 | |
/** | |
* An SplClassLoader implementation that implements | |
* the PHP 5.3 standards. | |
* | |
* @based on https://gist.github.com/221634 | |
*/ | |
class SplClassLoader { |
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 | |
# A basic quick sort implementation. | |
# It takes a list of numbers (separated by spaces), | |
# and it prints them out in ascending order. | |
quicksort() { | |
# The list passed in. | |
local LIST=($@) |
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 | |
/** | |
* The `OS` class helps run | |
* commands on the command line. | |
* | |
* @author JT Paasch | |
*/ | |
class OS { |
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 | |
# A function that checks if an item is not already in a list. | |
# The first argument is the item to check for, the rest are the list to check in. | |
# Returns 1 if the item is duplicated in the list, or 0 if it's not. | |
not_duplicated() { | |
# The first argument is the item to check for. | |
local ITEM=$1 |
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 | |
# Get all files in the folder. | |
FOLDER=/path/to/my/folder/* | |
# We'll build the list of file names here: | |
FILES=() | |
# Add just the basename of each FILE to the list of $FILES. | |
for FILE in $FOLDER |
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 | |
# The path to the file. | |
FILE=/path/to/my/file | |
# Read the file's contents. | |
CONFIG_CONTENTS=$(<$FILE) | |
# Split at the '='. | |
PARTS=(${CONFIG_CONTENTS//=/ }) |
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 | |
# The git comamnd `git status --porcelain` | |
# will return a list of files that have changed. | |
# We'll redirect the output to /dev/null | |
# so that the results of the command don't get | |
# printed to the screen. | |
CHANGED=no | |
if git status --porcelain | >/dev/null ; then |
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 | |
# ---------------------------------------------------------------------- | |
# Prelimenary checks | |
# ---------------------------------------------------------------------- | |
# Make sure there's a license key file. | |
KEYFILE="LICENSEKEY" | |
if [ ! -e $KEYFILE ]; then | |
echo "No LICENSEKEY found." |
OlderNewer