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 | |
/* | |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
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
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
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 | |
if ( ! function_exists( 'shortcode_exists' ) ) : | |
/** | |
* Check if a shortcode is registered in WordPress. | |
* | |
* Examples: shortcode_exists( 'caption' ) - will return true. | |
* shortcode_exists( 'blah' ) - will return false. | |
*/ | |
function shortcode_exists( $shortcode = false ) { | |
global $shortcode_tags; |
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
# Simple 16 step drum machine experiment with Node and CoffeeScript | |
# by Peter Cooper - @peterc | |
# | |
# Inspired by Giles Bowkett's screencast at | |
# http://gilesbowkett.blogspot.com/2012/02/making-music-with-javascript-is-easy.html | |
# | |
# Screencast demo of this code at http://www.youtube.com/watch?v=qWKkEaKL6DQ | |
# | |
# Required: | |
# node, npm and coffee-script installed |
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 | |
Route::filter('cache', function($response = NULL) { | |
$cname = 'response-' . Str::slug(URI::full()); | |
if (!$response) { | |
return Cache::get($cname); | |
} | |
else if ($response->status == 200) { | |
$ctime = floor(pow(current(sys_getloadavg()) + 1, 5)); # cache for between 1 and 32 minutes | |
Cache::put($cname, $response, $ctime); |
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 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'; |
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
# Filename-based cache busting | |
# taken from https://github.com/h5bp/html5-boilerplate/ | |
# This rewrites file names of the form `name.123456.js` to `name.js` | |
# so that the browser doesn't use the cached version when you have | |
# updated (but not manually renamed) the file. | |
<IfModule mod_rewrite.c> | |
Options +FollowSymlinks | |
RewriteEngine On |
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 | |
$x11 = array( | |
'aliceblue' => array( 240, 248, 255 ), | |
'antiquewhite' => array( 250, 235, 215 ), | |
'aqua' => array( 0, 255, 255 ), | |
'aquamarine' => array( 127, 255, 212 ), | |
'azure' => array( 240, 255, 255 ), | |
'beige' => array( 245, 245, 220 ), | |
'bisque' => array( 255, 228, 196 ), | |
'black' => array( 0, 0, 0 ), |
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
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/User/Espresso Soda.tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
".DS_Store", | |
".gitkeep", | |
"dump.rdb" | |
], |
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
/** | |
* Load Media Upload Scripts | |
* | |
* Load the JS & CSS needed for the media upload field | |
*/ | |
function enqueue_scripts() { | |
// Only load on widgets screen | |
$screen = get_current_screen(); | |
if ( $screen->id != 'widgets' ) |
OlderNewer