Skip to content

Instantly share code, notes, and snippets.

@michaeldyrynda
michaeldyrynda / gist:d3bb436f19cbdabaa6b7
Created January 16, 2015 00:43
Integer? Maybe. This has been done over and over, but it's still annoying as hell.
<?php
int 12345
string '12345'
filter_var(12345, FILTER_VALIDATE_INT); // true
filter_var('12456', FILTER_VALIDATE_INT); // true
'this is a string'
'12345'
~ traceroute paymentfont.io
traceroute to paymentfont.io (94.247.150.62), 64 hops max, 52 byte packets
1 home.gateway.home.gateway (192.168.1.254) 0.972 ms 0.653 ms 0.809 ms
2 lns20.adl2.on.ii.net (203.16.215.197) 22.439 ms 22.601 ms 22.376 ms
3 ae4.cr1.adl2.on.ii.net (150.101.225.16) 23.554 ms 23.442 ms 25.954 ms
4 ae0.cr1.adl6.on.ii.net (150.101.33.3) 193.220 ms 193.741 ms 193.571 ms
5 ae4.br1.syd7.on.ii.net (150.101.33.34) 62.828 ms * 44.780 ms
6 te-0-2-1-3.br1.sjc2.on.ii.net (150.101.33.251) 221.658 ms 223.928 ms
te0-1-1-2.br1.sjc2.on.ii.net (150.101.33.193) 217.514 ms
7 sl-st31-sj-.sprintlink.net (144.223.242.137) 202.261 ms 196.278 ms 198.701 ms
@michaeldyrynda
michaeldyrynda / gist:682f6f67e91dc0b96473
Created August 5, 2014 03:56
Shortcode method to generate an unordered HTML list of either child or sibling links, relative to the current post
<?php
/**
* Render an unordered HTML list of related page links
*
* @return string
*/
function renderRelatedLinks($atts)
{
global $post, $wpdb;
@michaeldyrynda
michaeldyrynda / gist:5289006
Created April 2, 2013 00:33
Fluid width container with three centred columns
<!DOCTYPE HTML>
<html>
<head>
<title>Center the divs</title>
<style>
body {
text-align: center;
margin: 0;
}
@michaeldyrynda
michaeldyrynda / gist:4678990
Created January 31, 2013 01:11
Asset mapping
<?php
/**
* Map static assets to dynamic filenames to facilitate fingerprinting
*/
$asset_map = array(
'bootstrap' => 'bootstrap_9b1012f3b7f1e418e089e2aed41e7cb0.min.css',
'style' => 'style_ca817061e12eefc141acc95578a235b2.min.css',
'wysihtml5' => 'wysihtml5_fe2bbcdc691e8bd0ee4235595fe4bb9f.css',
'ie8' => 'ie8_3b79519a57f6685a52b71533fc12e8f8.css',