Skip to content

Instantly share code, notes, and snippets.

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;
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
<?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'),
@tommywang
tommywang / Deploy.php
Last active May 25, 2016 08:38 — forked from oodavid/README.md
Deploy your site with git
# 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/
<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;
<!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>
@tommywang
tommywang / MySQL databases backup
Created November 10, 2014 06:37
Backup all local MySQL databases
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)"`
// 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'];
<?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
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