This file contains 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 getPositionFromBottom(element) { | |
return $(document).height() - element.offset().top - element.outerHeight() | |
} |
This file contains 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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( |
This file contains 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 | |
// load the 'fpdf' extension | |
require('fpdf.php'); | |
// just for demonstration purpose, the OP gets the content from a database instead | |
$h_img = fopen('img.jpg', "rb"); | |
$img = fread($h_img, filesize('img.jpg')); | |
fclose($h_img); | |
// prepare a base64 encoded "data url" |
This file contains 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
# Uses these 2 tools: | |
# http://wp-cli.org/ | |
# https://github.com/xwp/wp-cli-ssh | |
# Remote to local | |
wp ssh db export - --host=production | wp db import - | |
# Local to remote BEWARE THIS IS DANGEROUS BUT KEPT AS REFERENCE | |
wp db export - | wp ssh db import - --host=production |
This file contains 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 | |
/** | |
* PHP version 5.4 | |
* @category Export | |
* @package Language | |
* @author Tim Neutkens <tim@weprovide.com> | |
* @license MIT <https://opensource.org/licenses/MIT> | |
* @link <weprovide.com> | |
*/ |
This file contains 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 | |
/** | |
* Small utility function to get an excerpt. Standard length is 100 characters | |
* | |
* @param $string | |
* @param int $start_postion | |
* @param int $max_length | |
* | |
* @return string | |
*/ |
This file contains 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
GITDIR='remote'; echo ssh://${USER}@${HOSTNAME}:${PWD}/${GITDIR}.git |
This file contains 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
/** | |
* detect a click outside of an element and trigger callbacks based on that click. | |
* @param trigger | |
* @param element | |
* @param openCallback | |
* @param closeCallback | |
*/ | |
function DetectClickOutsideOfElement (trigger, element, openCallback, closeCallback) { | |
var enabled = false; |
This file contains 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
jQuery('[data-toggle="popover-hover"]').popover({ | |
trigger: 'manual', | |
html: true, | |
animation:false, | |
viewport: '.container' | |
}).on('mouseenter', function () { | |
var self = this; | |
jQuery(this).popover("show"); | |
jQuery(".popover").on('mouseleave', function () { | |
jQuery(self).popover('hide'); |
This file contains 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
// Create RewriteRule from given variables | |
function createRewriteString(oldUrl, newUrl, removeDomainPrefix) { | |
return 'RewriteRule ^' + oldUrl.replace(removeDomainPrefix, '') + '/?$ ' + newUrl + ' [NC,L,R=301]' | |
} | |
// Url to path mapping. Seperated by one space. | |
const urls = `http://example.com/foo/bar /bar/foo | |
http://example.com/foo/baz /baz/foo` | |
// Split by line break |
OlderNewer