Skip to content

Instantly share code, notes, and snippets.

View Mab213's full-sized avatar
🎯
Focusing

Mark Brinton Mab213

🎯
Focusing
View GitHub Profile
<?php
// Add to your (child) theme's functions.php
add_action( 'wp_footer', function() {
?>
<script>
(function($) {
$(document).on('facetwp-refresh', function() {
if ('undefined' !== typeof FWP_MAP) {
@mgibbs189
mgibbs189 / functions.php
Created September 12, 2016 12:41
FacetWP - sort by proximity distance
<?php
return array(
"post_type" => "job_listing",
"post_status" => "publish",
"orderby" => "post__in",
"order" => "ASC",
"posts_per_page" => 10
);
@fta2012
fta2012 / DragTransform
Last active March 8, 2025 15:05
Slightly modified compiled coffeescript from this codepen: http://codepen.io/fta/pen/ifnqH. Paste into console on a page that has jQuery to load the two dependent libraries (jquery-ui and numericjs). Then call makeTransformable('#selector-name') to make that element WYSIWYG editable. Use inspector to get the CSS for the transforms.
var selector = 'img' // Replace this with the selector for the element you want to make transformable
jQuery.getScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', function() {
jQuery.getScript('//cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js', function() {
(function() {
var $, applyTransform, getTransform, makeTransformable;
$ = jQuery;
@betweenbrain
betweenbrain / gist:5405671
Created April 17, 2013 16:26
Use cURL and SimpleXML to retrieve and parse Wordpress RSS feed
<?php
$curl = curl_init();
curl_setopt_array($curl, Array(
CURLOPT_URL => 'http://blogs.guggenheim.org/map/feed/',
CURLOPT_USERAGENT => 'spider',
CURLOPT_TIMEOUT => 120,
CURLOPT_CONNECTTIMEOUT => 30,
CURLOPT_RETURNTRANSFER => TRUE,