Skip to content

Instantly share code, notes, and snippets.

@ericpedia
ericpedia / gist:3903820
Created October 17, 2012 05:16
Relevanssi issue - returns zero results in custom query - print_r( $wp_query )
WP_Query Object
(
[query_vars] => Array
(
[post_type] => any
[posts_per_page] => 5
[s] => test
[error] =>
[m] => 0
[p] => 0
@ericpedia
ericpedia / gist:5942527
Last active December 19, 2015 10:39
Typophile small talk generator from http://typophile.com/smalltalk. Borrowed without permission, strictly for admirational purposes.
var max1 = 85;
var max2 = 61;
var max3 = 94;
var max4 = 52;
index1 = Math.round(Math.random() * max1);
index2 = Math.round(Math.random() * max2);
index3 = Math.round(Math.random() * max3);
index4 = Math.round(Math.random() * max4);
# How to upload local db to meteor:
# -h = host, -d = database name, -o = dump folder name
mongodump -h 127.0.0.1:3002 -d meteor -o meteor
# get meteor db url, username, and password
meteor mongo --url myapp.meteor.com
# Response will be something like this:
# mongodb://client:[email protected]:27017/myapp_meteor_com
@ericpedia
ericpedia / gist:6c6f4bda33d5a7e0f2c2
Last active August 29, 2015 14:05
WordPress: Remove date ranges from post titles
<?php
/**
* Remove date ranges from post titles
*
* @author ericpedia
* @since 2014-08-26
*
*/
@ericpedia
ericpedia / changeElementType.js
Last active August 29, 2015 14:09 — forked from etienned/changeElementType.js
Make it chainable
(function($) {
$.fn.changeElementType = function(newType) {
return this.each(function() {
var attrs = {};
$.each(this.attributes, function(idx, attr) {
attrs[attr.nodeName] = attr.nodeValue;
});
$(this).replaceWith(function() {