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 html5_canvas() { | |
// declare variables | |
var $canvas, $element, $circle, $rect, $triangle, $x, $limit, $angle, $centerY, $range, $speed; | |
//dom block element wrapper | |
$element = doodle.createDisplay("canvas"); | |
//creates new canvas element wrapper | |
$canvas = $element.createLayer(); | |
// function to create a random number |
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 fizzbuzz(a, b) { | |
for (var i = a; i <= b; i++) { | |
if (i % 3 == 0 && i % 5 == 0) { | |
console.log("Fizzbuzz"); | |
} else if (i % 5 == 0) { | |
console.log("Buzz"); | |
} else if (i % 3 == 0) { | |
console.log("Fizz"); | |
} else { | |
console.log(i); |
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 formatSql($sql) { | |
return preg_replace( | |
'/(select|from|(left |right |natural |inner |outer |cross |straight_)*join|where|limit|update |set|insert |values)/i', | |
"\n$1\n ", str_replace("\n", '', $sql) | |
); | |
} |
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
import java.io.IOException; | |
import java.lang.reflect.Method; | |
import play.Application; | |
import play.Logger; | |
import play.GlobalSettings; | |
import play.Configuration; | |
import play.mvc.Http.Request; | |
import play.mvc.Action; | |
import play.mvc.Http; |
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
MOBILE = window.MOBILE || {}; | |
MOBILE.QUERIES = (function() { | |
'use strict'; | |
// declare document and windows in variables for performace | |
var doc = document, | |
win = window; | |
var _private = { | |
set: function(args) { | |
// use the HTML5 API matchMedia to target phones and tablets |
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
WEB_WORKER = window.WEB_WORKER || {}; | |
WEB_WORKER = (function($, window) { | |
var _private = { | |
worker: null, | |
file: null, | |
web_worker: function() { | |
return !!window.Worker; | |
}, | |
set_url: function(args) { |
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 namespace content; | |
/** | |
* See blog post for details: http://www.suburban-glory.com/blog?page=174 | |
* | |
* Content_Type | |
* | |
* @package class for creating dynamic Wordpress metaboxes | |
* @author Andy Walpole | |
* @copyright AWalpole | |
* @version 2013 |
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 namespace content; | |
/** | |
* Category_Add_Field | |
* | |
* redirect() method is called in the header.php file | |
* if the user specifies an external URL in the category field | |
* | |
* @package class for creating dynamic Wordpress metaboxes | |
* @author Andy Walpole | |
* @copyright A Walpole |
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
jQuery(document).ready(function($) { | |
// Responsive wp_video_shortcode(). | |
$(".wp-video-shortcode") | |
.css("max-width", "100%") | |
.parent("div") | |
.css("width", "auto"); | |
}); |
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 html5_canvas() { | |
// declear variables | |
var $canvas, $rect, $circle, $triangle, $i, $limit, $width, $height; | |
//create canvas object with div id | |
$canvas = new fabric.Canvas('canvas_1'); | |
// create Circle - note radius |
OlderNewer