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
var safariDebug = ( navigator.platform.indexOf("iPhone") < 0 && navigator.platform.indexOf("iPod") < 0 && navigator.platform.indexOf("iPad") < 0 ); | |
if(safariDebug) | |
{ | |
PhoneGap.run_command = function() | |
{ | |
if (!PhoneGap.available || !PhoneGap.queue.ready) | |
return; |
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
(function(console){ | |
console.save = function(data, filename){ | |
if(!data) { | |
console.error('Console.save: No data') | |
return; | |
} | |
if(!filename) filename = 'console.json' |
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 | |
return array( | |
// Uncomment the languages that your site supports - or add new ones. | |
// These are sorted by the native name, which is the order you might show them in a language selector. | |
// Regional languages are sorted by their base languge, so "British English" sorts as "English, British" | |
'supportedLocales' => array( | |
//'ace' => array('name' => 'Achinese', 'script' => 'Latn', 'dir' => 'ltr', 'native' => 'Aceh'), | |
//'af' => array('name' => 'Afrikaans', 'script' => 'Latn', 'dir' => 'ltr', 'native' => 'Afrikaans'), |
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
# Deploy your site with git | |
This gist assumes: | |
* you have a local git repo | |
* with an online remote repository (github / bitbucket etc) | |
* and a cloud server (Rackspace cloud / Amazon EC2 etc) | |
* your (PHP) scripts are served from /var/www/html/ | |
* your webpages are executed by apache | |
* apache's home directory is /var/www/ |
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
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
var f_page = "wvumountaineers"; // the page name for your fan page, e.g. the 'wvumountaineers' part of http://facebook.com/wvumountaineers | |
var t_page = "westvirginiau"; // the account name for your main twitter account | |
function add_commas(number) { | |
if (number.length > 3) { | |
var mod = number.length % 3; |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Hello FB</title> | |
</head> | |
<body> | |
<div id="fb-root"></div> | |
<div id="fb-content"></div> | |
<div> |
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
TIMESTAMP=$(date +"%F") | |
BACKUP_DIR="" | |
MYSQL_USER="" | |
MYSQL=/usr/local/bin/mysql | |
MYSQL_PASSWORD="" | |
MYSQLDUMP=/usr/local/bin/mysqldump | |
mkdir -p "$BACKUP_DIR/mysql" | |
databases=`$MYSQL --user=$MYSQL_USER -p$MYSQL_PASSWORD -e "SHOW DATABASES;" | grep -Ev "(Database|information_schema|performance_schema)"` |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
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 | |
/* | |
* Plugin Name: Media Upload Widget | |
* Plugin URI: http://www.paulund.co.uk | |
* Description: A widget that allows you to upload media from a widget | |
* Version: 1.0 | |
* Author: Paul Underwood | |
* Author URI: http://www.paulund.co.uk | |
* License: GPL2 |
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
add_action('admin_init', 'my_general_section'); | |
function my_general_section() { | |
add_settings_section( | |
'my_settings_section', // Section ID | |
'My Options Title', // Section Title | |
'my_section_options_callback', // Callback | |
'general' // What Page? This makes the section show up on the General Settings Page | |
); | |
add_settings_field( // Option 1 |
OlderNewer