bindkey "^?" backward-delete-char
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// leastSquaresFit | |
/// Calculate the least square fit linear regression of provided values | |
/// @param {map} $map - A SASS map of viewport width and size value combinations | |
/// @return Linear equation as a calc() function | |
/// @example | |
/// font-size: leastSquaresFit((576: 24, 768: 24, 992: 34)); | |
/// @author Jake Wilson <[email protected]> | |
@function leastSquaresFit($map) { | |
// Get the number of provided breakpoints |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function create_auth_token($length = 64) | |
{ | |
if (!$length || intval($length) <= 8) { | |
$length = 64; | |
} | |
$bytes = null; | |
if (function_exists('random_bytes')) { | |
$bytes = random_bytes($length); | |
} elseif (function_exists('mcrypt_create_iv')) { | |
$bytes = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$param_value = isset( $$param['param_name'] ) ? $$param['param_name'] : ''; | |
$param_value = isset(${$param['param_name']}) ? ${$param['param_name']} : ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_ROOT=$1 # <-- wordpress root directory | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Return an ID of an attachment by searching the database with the file URL. | |
* | |
* First checks to see if the $url is pointing to a file that exists in | |
* the wp-content directory. If so, then we search the database for a | |
* partial match consisting of the remaining path AFTER the wp-content | |
* directory. Finally, if a match is found the attachment ID will be | |
* returned. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Used to @include a cursor within a pre-existing class | |
@mixin cursor($cursor-type) { | |
cursor: $cursor-type; | |
} | |
// Used to generate cursor classes | |
@mixin cursor-class($cursor-type) { | |
.#{$cursor-type}-cursor { cursor: $cursor-type; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"repositories": [ | |
{ | |
"type": "package", | |
"package": { | |
"name": "advanced-custom-fields/advanced-custom-fields-pro", | |
"version": "5.0", | |
"type": "wordpress-plugin", | |
"dist": { | |
"type": "zip", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var googleMapsLoaded = false; | |
var timeout; | |
if(googleMapsLoaded === false) { | |
timeout = setInterval("checkVariable()", 500); | |
} | |
function doGoogleMapsHook() { | |
// set current zoom level | |
var currentZoom = parseInt(jQuery('#acf-field-zoom_level').val()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$autoplay = ''; | |
// if shortcode has attribute "autoplay", use autoplay on slider | |
if ( isset($atts['autoplay']) ) { | |
$delay = (int)$atts['autoplay']; | |
$autoplay = ' data-sliderautoplay=""'; | |
if ( 0 < $delay ) { | |
// if $delay < 1000, suppose value unit is meant to be seconds | |
if ( 1000 > $delay ) { | |
$delay*= 1000; | |
} |