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 droidshot { | |
saveto=~/droidshots | |
fname=$(date +"%Y%m%d%H%M").png | |
[[ ! -z $1 ]] && fname=$1 | |
[[ -d $saveto ]] || mkdir $saveto | |
adb shell screencap -p /sdcard/$fname | |
adb pull /sdcard/$fname $saveto/$fname | |
adb shell rm /sdcard/$fname | |
echo "saved to $saveto/$fname" | |
} |
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
alias fucking='sudo ' | |
alias doit='$(history -p !!)' |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html;charset=utf-8"/> | |
<!-- Online here: http://ejohn.org/files/bugs/isObjectLiteral/ --> | |
<title>isObjectLiteral</title> | |
<style> | |
li { background: green; } li.FAIL { background: red; } | |
iframe { display: none; } | |
</style> |
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
<html> | |
<head> | |
<title>prime number checker</title> | |
<style> | |
body, input{ | |
font-family: Georgia, serif; | |
background-color: white; |
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 | |
define('cache', realpath('./cacheddata/icons/')); | |
$h = 28; | |
$w = 28; | |
$iurl = &$_GET['i']; | |
$file = cache . DIRECTORY_SEPARATOR . sha1("$w/$h/$iurl").'.jpg'; | |
header("Content-type: image/jpeg"); |
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($){ | |
$.fn.kidFader = function(){ | |
return $(this).each(function(){ | |
$(this).hover(function(){ | |
$(this) | |
.children('.hover').stop(1,1).hide().fadeIn('fast') | |
.end() | |
.children('.normal').stop(1,1).fadeOut('fast'); | |
}, function(){ |
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($){ | |
$.fn.redraw = function(){ | |
return $(this).each(function(){ | |
var n = document.createTextNode(' '); | |
$(this).append(n); | |
setTimeout(function(){n.parentNode.removeChild(n)}, 0); | |
}); | |
} | |
})(jQuery) |
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($){ | |
$.fn.parseData = function(){ | |
return $(this).filter('[js-data]').each(function(){ | |
var data = jQuery.parseJSON($(this).attr('js-data')), prop; | |
for(prop in data) | |
$(this).data(prop, data[prop]); | |
}).end(); | |
} | |
})(jQuery); |
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
$('.some-snazzy-selector').click(function(ev){ | |
if( ev.which == 2 || ev.metaKey || ev.ctrlKey || ev.shiftKey ){ | |
return true; | |
} | |
// Ajax Magic here | |
}); |
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
$.fn.hint = function(hint){ | |
var val = $(this).eq(0).bind('focus', function(){ | |
$(this).removeClass('hinting'); | |
if($(this).val() == hint) $(this).val(''); | |
}).bind('blur', function(){ | |
if($(this).val() == '') $(this).addClass('hinting').val(hint); | |
}).bind('change', function(){ | |
$(this).removeClass('hinting'); | |
}).val(); | |
if(! /\S/.test(val)) $(this).eq(0).val(hint).addClass('hinting'); |
OlderNewer