Skip to content

Instantly share code, notes, and snippets.

View Paul-Browne's full-sized avatar
🏠
Working from home

Paul Browne Paul-Browne

🏠
Working from home
View GitHub Profile
@StephenFluin
StephenFluin / app.js
Created October 9, 2015 14:47
Sample Trello node.js Webhook Server
/**
* This is a sample webhook server that listens for webhook
* callbacks coming from Trello, and updates any cards that are
* added or modified so everyone knows they are "PRIORITY"
*
* To get started
* * Add your key and token below
* * Install dependencies via `npm install express request body-parser`
* * Run `node app.js` on a publicly visible IP
* * Register your webhook and point to http://<ip or domain>:3123/priority
@kylephillips
kylephillips / favorites-post-table.php
Created September 2, 2015 19:11
Add favorite counts to the WP admin post tables
<?php
// Place this code in your theme's functions.php file
/**
* First, add the column to the view
* Change the post type by substituting 'post' with the post type
* Ex: a post type of recipe would be manage_recipe_posts_columns
*/
add_filter('manage_post_posts_columns', 'add_favorite_count_column');
@Paul-Browne
Paul-Browne / index.html
Last active August 29, 2015 14:25 — forked from anonymous/index.html
JS Bin livewriter // source https://jsbin.com/ruvagu
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="livewriter">
<meta charset="utf-8">
<title>JS Bin</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://rawgit.com/Paul-Browne/f20cc6c735021f6e3790/raw/56e2b6fae22811a3e44f7e2d51d7fcfada8b68b8/caret.js"></script>
<style id="jsbin-css">
body{margin:0}
@kylephillips
kylephillips / favorites-display.php
Last active October 14, 2022 19:33
Using the Favorites get_user_favorites() function to display favorited post data in a custom format
<?php
// Method 1: simple foreach loop
$favorites = get_user_favorites();
if ( isset($favorites) && !empty($favorites) ) :
foreach ( $favorites as $favorite ) :
// You'll have access to the post ID in this foreach loop, so you can use WP functions like get_the_title($favorite);
endforeach;
endif;
@Paul-Browne
Paul-Browne / gist:a9e11b8a5c512cab0472
Last active August 29, 2015 14:02
resets | typography | iconfont | misc | indent | print | buttons | tables | inputs
/* requires <link href='http://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,600|Droid+Serif:400italic' rel='stylesheet' type='text/css'> */
/*requires iconfont in directory*/
/* windows phone 8 initial-scale bug fix */
@-ms-viewport{width: device-width}
/* normalize */
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
body{margin:0}
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}
audio,canvas,progress,video{display:inline-block;vertical-align:baseline}
audio:not([controls]){display:none;height:0}
@zenorocha
zenorocha / multiple-3rd-party-widgets.js
Last active November 14, 2022 12:18
Loading multiple 3rd party widgets asynchronously
(function() {
var script,
scripts = document.getElementsByTagName('script')[0];
function load(url) {
script = document.createElement('script');
script.async = true;
script.src = url;
scripts.parentNode.insertBefore(script, scripts);
@stowball
stowball / wp8-ie10-fix.js
Last active April 17, 2022 19:09
Microsoft's stop-gap solution to fix IE 10 & 11's viewport on Windows Phone 8. I've also added another condition so it won't run on other browsers that spoof the user agent. Details: http://mattstow.com/responsive-design-in-ie10-on-windows-phone-8.html
(function() {
if ("-ms-user-select" in document.documentElement.style && navigator.userAgent.match(/IEMobile/)) {
var msViewportStyle = document.createElement("style");
msViewportStyle.appendChild(
document.createTextNode("@-ms-viewport{width:auto!important}")
);
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
})();
@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */