Skip to content

Instantly share code, notes, and snippets.

View michaeldyrynda's full-sized avatar

Michael Dyrynda michaeldyrynda

View GitHub Profile
@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',
@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: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;
~ 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: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'
<?php
$rbls = [
'b.barracudacentral.org',
'cbl.abuseat.org',
'http.dnsbl.sorbs.net',
'misc.dnsbl.sorbs.net',
'socks.dnsbl.sorbs.net',
'web.dnsbl.sorbs.net',
'dnsbl-1.uceprotect.net',
@michaeldyrynda
michaeldyrynda / envswitch.sh
Last active August 29, 2015 14:14
Easily swap out environment config in Laravel 5
function envswitch() {
if [ ! "$1" ]
then
echo "Missing required parameter envname"
echo "File should exist in current directory as .env.envname"
echo "Usage:"
echo " envswitch envname"
return
fi

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@michaeldyrynda
michaeldyrynda / Envoy.blade.php
Last active July 13, 2023 17:40
Laravel 5 Envoy deploy configuration
@servers([ 'remote' => 'server.example.com', ])
@setup
if ( ! isset($repo) )
{
throw new Exception('--repo must be specified');
}
if ( ! isset($base_dir) )
{
@michaeldyrynda
michaeldyrynda / Envoy.blade.php
Last active March 25, 2016 02:43
Laravel 4 Envoy deploy configuration
@servers([ 'remote' => 'server.example.com'])
@setup
if ( ! isset($repo) )
{
throw new Exception('--repo must be specified');
}
if ( ! isset($base_dir) )
{