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 | |
/* | |
Title: TwentyEleven Child Theme Shiv | |
Version: .02 | |
Author: Ash Blue | |
Author URL: http://www.blueashes.com | |
Repository URL: https://gist.github.com/gists/1154369/ | |
*/ |
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
To use this drop it into any content area with a WYSIWYG in the HTML view. Do not post into the visual view or the sky will fall. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent pellentesque vestibulum diam, id placerat nisi tempor quis. Proin erat metus, accumsan in sagittis vitae, suscipit a eros. Nam interdum pellentesque felis consequat condimentum. Maecenas nec augue justo. Vestibulum vehicula sodales diam nec volutpat. | |
<!--more--> | |
<h1>Header 1</h1> | |
<h2>Header 2</h2> | |
<h3>Header 3</h3> | |
<h4>Header 4</h4> | |
<h5>Header 5</h5> | |
<h6>Header 6</h6> |
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
# To use this script you must replace the first url http://currentsite.com to http://newsite.com and run it in your MySQL | |
UPDATE asdf_options SET option_value = REPLACE(option_value, 'http://currentsite.com', 'http://newsite.com'); | |
UPDATE asdf_postmeta SET meta_value = REPLACE(meta_value, 'http://currentsite.com', 'http://newsite.com'); | |
UPDATE asdf_posts SET guid = REPLACE(guid, 'http://currentsite.com', 'http://newsite.com'); | |
UPDATE asdf_posts SET post_content = REPLACE(post_content, 'http://currentsite.com', 'http://newsite.com'); | |
UPDATE asdf_rg_lead SET source_url = REPLACE(source_url, 'http://currentsite.com', 'http://newsite.com'); |
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
loginStatus: function() { | |
FB.getLoginStatus(function(response) { | |
if (response.status === 'unknown') { | |
NRD.Scroll.offset = 130; | |
} | |
}); | |
} |
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
/** | |
* Append an existing callback. | |
* @param {function} callback Callback to append. | |
* @param {function} append Data appended to the existing callback. | |
* @returns {function} Returns the newly assembled callback. | |
*/ | |
function appendCallback(callback, append) { | |
var newCallback = function () { | |
callback(); | |
append(); |
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
/** | |
* Creates a bounding box from multiple square objects and returns a rectangle. | |
* @param {array} squares An array of square objects such as [square1, square2]. Must have | |
* x, y, width, and height parameters for each object of the sky will fall | |
* @returns {object} Returns the bounding box of the current squares | |
*/ | |
function getBoundingBox(squares) { | |
// Setup basic test properties | |
var x = Number.POSITIVE_INFINITY; | |
var y = Number.POSITIVE_INFINITY; |
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 hexToRGB(hex) { | |
// Strip '#' | |
var nums = hex.slice(1); | |
// If they pass in a shorthand hexcode convert it | |
if (nums.length === 3) { | |
var numStack = ''; | |
for (var i = 0; i < nums.length; i++) { | |
numStack += nums.charAt(i) + nums.charAt(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
/** | |
* Create a square bounding box from an array of x and y points | |
* @param {array} A collection of objects with x and y coordinates {x, y} | |
* @returns {object} Square formatted as {x, y, width, height} from the given vertices | |
*/ | |
function getBoundingBox (vertices) { | |
// Setup basic test properties | |
var xMin = Number.POSITIVE_INFINITY, | |
yMin = Number.POSITIVE_INFINITY, | |
xMax = 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
/** | |
* Sorts an array by a specific property | |
* @link https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/sort | |
* @example http://jsfiddle.net/truefreestyle/Fqn4J/34/ | |
* @param {array} arrayTarget Array of JSON objects you want to sort | |
* @param {string} property JSON property you want to sort by | |
* @returns {undefined} | |
*/ | |
function arraySort (arrayTarget, property) { | |
arrayTarget.sort(function (a, b) { |
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
/** | |
* Gets the top left corner of a square from two vertices. Uses nested | |
* if statements, but its the best way to opimize performance. Point | |
* parameters can be passed in any order. | |
* @param {object} point1 Object formatted as { x, y } on a cartesian graph | |
* @param {object} point1 Object formatted as { x, y } on a cartesian graph | |
* @returns {object} { x, y } of the top left corner on a square | |
*/ | |
function getSquareTopLeft (point1, point2) { | |
// Declare coordinate collection variables |
OlderNewer