This file contains hidden or 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
/** | |
* async xhr, provides a modern browser | |
* ajax api with less suck | |
* | |
* author: dhigginbotham | |
* license: MIT | |
*/ | |
(function (root) { | |
/** |
This file contains hidden or 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
/** | |
* async loader | |
* author: dhigginbotham | |
*/ | |
(function(root) { | |
/** | |
* public api | |
*/ |
This file contains hidden or 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
app.factory('$preload', ['$templateCache', '$http', | |
function ($templateCache, $http) { | |
// angular.js preload template factory, the purpose of this | |
// is to preload all of your applications templates, once. | |
// all callbacks should fire with (err, data) node.js style | |
// flow. | |
var internalHttpRequest = function (url, fn) { | |
$http.get(url).success(function (data) { | |
return fn(data); | |
}); |
This file contains hidden or 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
$args = array( | |
'post_type' => 'my_custom_post_type', | |
'meta_key' => 'age', | |
'orderby' => 'meta_value_num', | |
'order' => 'ASC', | |
'meta_query' => array( | |
array( | |
'key' => 'age', | |
'value' => array(3, 4), | |
'compare' => 'IN', |
This file contains hidden or 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 express = require('express'), | |
_ = require('underscore'), | |
request = require('superagent'), | |
app = express(), | |
server = require('http').createServer(app); | |
app.set('port', 5555); | |
app.use(express.json()); | |
app.use(express.urlencoded()); |
This file contains hidden or 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
app.factory('schemaInitializer', [ '$rootScope', '$resource', function ($rootScope, $resource) { | |
// service for `schemaInitializer` this will give you a schema | |
// with access to it's children in a consistent manner, that is easy to use. | |
var schema = { | |
title: '', | |
slug: '', | |
panels: [], | |
chartColors: [], |
This file contains hidden or 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 (root) { | |
// small event emitter | |
var emit = function () { | |
this.events = []; | |
this.watchers = {}; | |
this.add = function (event, ctx) { | |
if (typeof ctx == 'undefined') ctx = this; | |
this.events.push({event: event}); |
This file contains hidden or 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
app.factory('xhr', | |
[ '$http', function ($http) { | |
var xhr = {}; | |
var methods = ['get', 'head', 'post', 'put', 'delete', 'jsonp']; | |
var internalHttpRequest = function (opts, fn) { | |
var req = {method: 'get', url: null}; | |
if (opts) angular.extend(req, opts); | |
$http(req).success(function (data, status, headers, config) { | |
return fn(null, data); |
This file contains hidden or 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 unique = function (arr, fn) { | |
// callback, so we can async or not (your choice!) | |
var callback = ((typeof fn != 'undefined') && (typeof fn == 'function')) ? fn : null; | |
var a = ((typeof arr != 'undefined')) ? arr : null; | |
var ln = 0; | |
var newArray = []; |
This file contains hidden or 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
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl'); |