Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
/* | |
SCSS Color Methods for Accessibility | |
================================================================================ | |
Adjust given colors to ensure that those color combination provide sufficient | |
contrast. | |
@version 0.1 | |
@link http://eye48.com/go/scsscontrast |
Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
// Mixin | |
@mixin keyframes($name) { | |
@-moz-keyframes #{$name} { @content; } | |
@-webkit-keyframes #{$name} { @content; } | |
@-o-keyframes #{$name} { @content; } | |
@-ms-keyframes #{$name} { @content; } | |
@-khtml-keyframes #{$name} { @content; } | |
@keyframes #{$name} { @content; } | |
} |
// Check if IE8 or lower | |
isOldIE: document.documentElement.className.search('old-ie') >= 0, | |
// Force IE8 to redraw :before/:after pseudo elements | |
// http://stackoverflow.com/questions/9809351/ | |
redrawPseudoEls: function() { | |
var self = this; | |
if ( self.isOldIE ) { | |
console.log('redraw pseudo elements'); | |
var head = document.getElementsByTagName('head')[0], |
<?php | |
function sanitize_phone( $phone, $international = false ) { | |
$format = "/(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?$/"; | |
$alt_format = '/^(\+\s*)?((0{0,2}1{1,3}[^\d]+)?\(?\s*([2-9][0-9]{2})\s*[^\d]?\s*([2-9][0-9]{2})\s*[^\d]?\s*([\d]{4})){1}(\s*([[:alpha:]#][^\d]*\d.*))?$/'; | |
// Trim & Clean extension | |
$phone = trim( $phone ); | |
$phone = preg_replace( '/\s+(#|x|ext(ension)?)\.?:?\s*(\d+)/', ' ext \3', $phone ); |
This is a quick tutorial explaining how to get a static website hosted on Heroku.
Why do this?
Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.
On WP install the plugin SAML 2.0 Single Sign-On
Once installed, copy and paste into an email the section “Your SAML Info”
Make sure to check only the box labeled ‘Allow SSO Bypass’.
Click Service Provider tab and put a check in the “Generate new certificate and private key for me.” then click update at the bottom of the page.
<?php | |
/* | |
Plugin Name: Programmatically add Gravity Forms | |
Plugin URI: https://daan.kortenba.ch/programmatically-add-gravity-forms/ | |
Description: Programmatically add persistent Gravity Forms forms. | |
Author: Daan Kortenbach | |
Version: 0.1 | |
Author URI: https://daan.kortenba.ch/ | |
License: GPLv2 or later | |
*/ |
add_action( 'gform_after_create_post', 'gf_add_to_media_library', 10, 3 ); | |
/** | |
* Save file upload fields under custom post field to the library | |
* | |
* @param $post_id The post identifier | |
* @param $entry The entry | |
* @param $form The form | |
*/ |
<?php | |
/** | |
* Recursively get taxonomy and its children | |
* | |
* @param string $taxonomy | |
* @param int $parent - parent term id | |
* @return array | |
*/ | |
function get_taxonomy_hierarchy( $taxonomy, $parent = 0 ) { |