Skip to content

Instantly share code, notes, and snippets.

var media = new Media('temp.wav', function() {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fs) {
fs.root.getFile('temp.wav', {}, function(file) {
// targetDir has been created previously
file.moveTo(targetDir, 'audio.wav', function() {
// done!
});
});
});
});
@rosshanney
rosshanney / gce-remove-tooltip-js.php
Created September 30, 2013 19:28
Remove tooltip stuff from GCE JavaScript.
<?php
/*
Plugin name: GCE - Remove tooltip JS
*/
function gce_remove_tooltip_js() {
if ( defined( 'GCE_GENERAL_OPTIONS_NAME' ) ) {
$options = get_option( GCE_GENERAL_OPTIONS_NAME );
wp_deregister_script( 'gce_scripts' );
@rosshanney
rosshanney / gce-change-ajax-url.php
Created September 27, 2013 19:40
Changes GCE Ajax URL for Triangle Day School site.
<?php
/*
Plugin name: Change GCE Ajax URL
*/
function gce_change_ajax_url() {
?>
<script type="text/javascript">
var GoogleCalendarEvents = GoogleCalendarEvents || {};
GoogleCalendarEvents.ajaxurl = "http://triangledayschool.previewdns.com/wp-admin/admin-ajax.php";
@rosshanney
rosshanney / gce-prevent-tz-issue.php
Created August 30, 2013 18:49
Prevent Timezone Issue with BackWPup Plugin
<?php
/*
Plugin name: GCE Prevent Timezone Issue with BackWPup Plugin
*/
define( 'RAXSDK_TIMEZONE', 'UTC' );
@rosshanney
rosshanney / gce-load-polylang-on-ajax.php
Created August 10, 2013 20:31
Ensure that Polylang plugin is loaded on Ajax request, to ensure calendar output is translated
<?php
/*
Plugin name: GCE Load Polylang on Ajax requests
*/
function gce_load_polylang_on_ajax() {
?>
<script type="text/javascript">
if (typeof jQuery != 'undefined') {
jQuery.ajaxSetup({
@rosshanney
rosshanney / gce-fix-month-navigation.php
Created August 10, 2013 19:39
Prevent an issue caused by JavaScript loaded by the "Touch" theme, that causes month navigation links to 404
<?php
/*
Plugin name: GCE Fix Month Navigation Issue
*/
function gce_fix_month_navigation() {
?>
<script>
if (typeof jQuery != 'undefined') {
jQuery(document).ready(function(){
@rosshanney
rosshanney / gce-fixes-for-slydawgg.php
Created July 26, 2013 18:34
Add jQuery migrate and fix JavaScript error
<?php
/*
Plugin name: Add jQuery migrate and fix JavaScript error
*/
function gce_add_jquery_migrate() {
wp_enqueue_script( 'jquery-migrate', 'http://code.jquery.com/jquery-migrate-1.2.1.min.js', array( 'jquery') );
}
function gce_fix_javascript_error() {
<?php
/*
Plugin name: Update jQuery UI
*/
function gce_update_jquery_ui() {
wp_deregister_script( 'jquery-ui' );
wp_enqueue_script( 'jquery-ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js', array( 'jquery' ), null, true );
}
@rosshanney
rosshanney / gce-event.php
Created June 3, 2013 18:47
Update gce-event.php to add [if-zero-length] and [if-not-zero-length] shortcodes for Justin
<?php
class GCE_Event{
private $id;
private $title;
private $description;
private $location;
private $start_time;
private $end_time;
private $link;
private $type;
@rosshanney
rosshanney / gce-set-paginateval.php
Created May 23, 2013 20:07
Fix issue with Category Grid View Gallery plugin
<?php
/*
Plugin name: Fix issue with Category Grid View Gallery plugin
*/
function gce_set_paginateval() {
global $paginateVal;
if ( ! isset( $paginateVal ) ) {
$paginateVal = 0;