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
git grep '<string to search for>' | awk '{print $1}' | sed 's/:$//' | sort -u |
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 | |
$posts = [ | |
[ | |
'id' => 1231, | |
'title' => 'Test' | |
], | |
[ | |
'id' => 1111, | |
'title' => 'Test #2' |
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
#!/usr/bin/env bash | |
# need to set env variable for the public base url for the photos | |
if [[ -z "$WEDDING_URL_PREFIX" ]]; then | |
printf '\nError: WEDDING_URL_PREFIX needs to be set in your environment!\n' | |
exit 1 | |
fi | |
# image filenames had two different prefixes | |
IMG_TOTAL=2405 |
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
// @example | |
// <iframe src="/form.html" id="infographic-iframe"></iframe> | |
document.getElementById('infographic-iframe').style.height = $('#infographic-iframe').contents().height() + 'px'; | |
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 | |
add_action('init', 'redirect_short_links'); | |
function redirect_short_links() | |
{ | |
$id = $_GET['p']; | |
// do not redirect post previews | |
if (! $id || !preg_match('/^\d+$/', $id) || !empty($_GET['preview'])) { |
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 | |
ini_set('display_errors',1); | |
ini_set('display_startup_errors',1); | |
error_reporting(-1); | |
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
#!/bin/bash | |
# | |
# some shortcomings: | |
# - prankee needs to be running rvm, rbenv, or some other | |
# ruby version manager that doesn't require sudo permissions to | |
# install gems. | |
# - can be killed by simply closing current tab/session | |
# | |
# Any bug reports or suggestions on improvements are welcome! | |
# |
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
var html = '<iframe width="420" height="315" src="https://www.youtube.com/embed/cwhLueAWItA" frameborder="0" allowfullscreen></iframe>'; | |
var width = html.match( /(?:.*width="(.*?)".*)?/i ).pop(); | |
var height = html.match( /(?:.*height="(.*?)".*)?/i ).pop(); | |
var src = html.match( /(?:.*src="(.*?)".*)?/i ).pop(); | |
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
/** | |
* Useful helpers for the handlebars js templating library | |
* | |
* @uses Handlebars | |
* @link https://gist.github.com/elidupuis/1468937 <Some credit due> | |
*/ | |
;(function(Handlebars, window, document, undefined) { | |
'use strict'; | |
/** |
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
var multiLiner = String() + | |
'<section>' + | |
'<div class="content-wrapper">' + | |
'<a href="#" class="js-link">Click Here</a>' + | |
'</div>' + | |
'</section>'; | |