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
// Simple, tiny, dumb module definitions for Browser JavaScript. | |
// | |
// What it does: | |
// | |
// * Tiny enough to include anywhere. Intended as a shim for delivering | |
// browser builds of your library to folks who don't want to use script loaders. | |
// * Exports modules to `__modules__`, a namespace on the global object. | |
// This is an improvement over typical browser code, which pollutes the | |
// global object. | |
// * Prettier and more robust than the |
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 | |
/** | |
* Open Graph Tags | |
* | |
* Add Open Graph tags so that Facebook (and any other service that supports them) | |
* can crawl the site better and we provide a better sharing experience. | |
* | |
* @link http://ogp.me/ | |
* @link http://developers.facebook.com/docs/opengraph/ | |
*/ |
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
/** | |
* Provides requestAnimationFrame in a cross browser way. | |
* @author paulirish / http://paulirish.com/ | |
*/ | |
if ( !window.requestAnimationFrame ) { | |
window.requestAnimationFrame = ( function() { | |
return window.webkitRequestAnimationFrame || |
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 python | |
""" | |
Ever had a mysqldump of utf8 data stored in latin1 tables, dumped in utf8 and | |
munged with windows cp1252? | |
If so this is your friend. Just pipe it through this little baby and spare | |
yourself hours of unicode hell- it'll take your dirt and spit out clean utf8. | |
You can also import it and use it in your python code. |
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 StateMachine = { | |
// Register valid states for this object. | |
__states__: { | |
'success': ['failure'], | |
'failure': ['success'] | |
}, | |
// Set initial state. | |
__state__: 'success', |
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
# It's important to convert the vbox image (VMDK or VDI or whatever) using | |
# the same version of VirtualBox that created it. You can try converting the image | |
# with qemu-img or kvm-img, but weird version mismatches will possibly make it not | |
# work. | |
# On your VirtualBox machine: | |
cd $VBOX_ROOT/$MACHINE_ROOT/ | |
VBoxManage clonehd machine.vmdk machine.img --format RAW | |
scp machine.img root@kvm-host:/somewhere |
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
/** | |
* Routes all email from WP installation to specific Mailtrap | |
* account inbox. | |
* | |
* All you need to do is change the "Username" and "Password" | |
* settings to the appropriate box in Mailtrap. Then all | |
* mail **should** be routed to that box. Exceptions would | |
* be other functionality that overwrite the wp_mail() functions | |
* and may not use this filter, or other filters that change | |
* this behavior after we set it, or millions of other things. |
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
javascript:$=jQuery;if(0!==$("#myogdiv").length)$("#myogdiv").hide().remove();else{var%20myogdiv=$('<div%20id="myogdiv"/>');$("body").append(myogdiv);$('head%20meta[property^="og:"],head%20meta[property^="fb:"],head%20meta[name^="twitter:"]').each(function(d,b){var%20a=$(b).attr("property"),c=$(b).attr("content");void%200==a&&(a=$(b).attr("name"));$(myogdiv).append("<div><b>"+a+":</b>"+c+"</div>");"og:image"==a&&$(myogdiv).append('<br/><img%20src="'+c+'"%20style="max-width:250px"/>');"twitter:image"==a&&$(myogdiv).append('<br/><img%20src="'+c+'"%20style="max-width:250px"/>')});$(myogdiv).css("position","absolute").css("top","0").css("zIndex",9999999).css("padding","0.5em").css("border","1px%20solid%20red").css("backgroundColor","white")}void%200; |
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
/** | |
* Outbound link tracking | |
* | |
* This code largely based on examples from | |
* [Google Analytics Help](http://www.google.com/support/googleanalytics/bin/answer.py?answer=55527). | |
*/ | |
jQuery(function($){ | |
$('a:not([href*="' + document.domain + '"])').click(function(event){ | |
// Just in case, be safe and don't do anything | |
if (typeof _gat == 'undefined') { |
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
for f in ~/Dropbox/bash/*; do source $f; done |
NewerOlder