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
if (!-e $request_filename) { | |
rewrite /wp-admin$ $scheme://$host$uri/ permanent; | |
rewrite ^(/[^/]+)?(/wp-.*) /wp$2 last; | |
rewrite ^(/[^/]+)?(/.*\.php)$ /wp$2 last; | |
} |
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 | |
cowfiles=$(cowsay -l | grep -v \/) | |
for cowfile in $cowfiles | |
do | |
cowsay -f $cowfile "$cowfile" | |
done |
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
untrailingSlashIt(str) { | |
return str.replace(/\/$/, ''); | |
} | |
trailingSlashIt(str) { | |
return untrailingSlashIt(str) + '/'; | |
} |
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
document.addEventListener('mousemove', function (event) { | |
console.log(event.type); | |
}, 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
/** | |
* Convert URL parameters to an object. | |
* | |
* @param {String} url | |
* @return {Object} | |
*/ | |
function getUrlParams( url ) { | |
// Use the passed in string or the current URL. | |
url = url || document.location.href; |
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
$.ajax({ | |
url: 'https://gist.github.com/matthewspencer/5968c0064b1ea73c4f42.json', | |
dataType: 'jsonp', | |
timeout: 1000, | |
success: function (data) { | |
$(document.head).append('<link href="' + data.stylesheet + '" rel="stylesheet">') | |
$(document.body).append(data.div) | |
} | |
}) |
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 | |
/** | |
* Twig filter for converting Markdown | |
* | |
* @uses Jetpack | |
* @uses WPCom_Markdown | |
*/ | |
add_filter( 'get_twig', function ( $twig ) { |
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 | |
vowels=( A a E e I i O o U u Y y ) | |
input=$1 | |
for vowel in "${vowels[@]}" | |
do | |
input="${input//$vowel/}" | |
done |
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 _ = require( 'underscore' ); | |
var fs = require( 'fs' ); | |
var strava = require( 'strava-v3' ); | |
var logFile = 'data/log.txt'; | |
var requestCount = 1; | |
var runsPath = '../runs/gpx/'; | |
fs.readdir( runsPath, function ( err, files ) { | |
if ( err ) { |
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
## Get rid of Google Updater | |
## http://superuser.com/questions/837678/how-can-i-get-rid-of-googlevoiceandvideoaccelsetup-on-mac-os-yosemite | |
alias fuckgoogleupdater="sudo rm -rf /private/tmp/2014*; sudo rm -rf /Library/Caches/com.google.SoftwareUpdate.0; killall Finder" |