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 map_range(value, low1, high1, low2, high2) { | |
return low2 + (high2 - low2) * (value - low1) / (high1 - low1); | |
} |
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 contenteditable spellcheck="true" id="f" style="font-size:2rem;line-height:1.4;max-width:60rem;margin:0 auto;padding:4rem;"><title>Skratch Pad</title><script>window.onload=function(){var f=document.getElementById('f');f.innerHTML=r(localStorage.f)};onkeyup=function(){localStorage.f=f.innerHTML};function r(f){var e =/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;return f.replace(e,"<a href='$1' style='cursor:pointer' onclick='window.open(this.href);return false'>$1</a>")}</script><style>body{color:#242424; background-color:#fffff2; padding:10px;border-radius:4px;box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.2);} #f{background-color:#eee;}</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
######################################### | |
prevent script execution in directory | |
useful when access permissions and to be lax | |
IndexIgnore * | |
Options All -Indexes | |
# Secure directory by disabling script execution, add any extentions required | |
AddHandler cgi-script .php .php2 .php3 .php4 .php5 .php6 .php7 .php8 .pl .py .jsp .asp .htm .html .shtml .sh .cgi |
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
// History.js It! | |
// v1.0.1 - 30 September, 2012 | |
// | |
// fork of https://gist.github.com/854622 with the scrollto functionality removed | |
(function(window,undefined){ | |
// Prepare our Variables | |
var | |
History = window.History, |
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
//Strip out the generator meta | |
function remove_generator() { | |
return ''; | |
} | |
add_filter('the_generator', 'remove_generator'); |
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
<entry type="iradio"> | |
<title>Radio Kerry</title> | |
<genre>Varied</genre> | |
<artist></artist> | |
<album></album> | |
<location>http://www.radiokerry.ie/RK_MP3HQ1.asx</location> | |
<play-count>46</play-count> | |
<last-played>1330551764</last-played> | |
<bitrate>128</bitrate> | |
<date>0</date> |
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> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> | |
<script type="text/javascript" src="https://raw.github.com/blasten/turn.js/master/turn.min.js"></script> | |
<style> | |
body{ | |
background:#ccc; | |
} |
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 | |
$error = array ( | |
//4xx: Client Error | |
400 => array("title" => "Bad Request", "desc" => "The server did not understand the request"), | |
401 => array("title" => "Unauthorized", "desc" => "The requested page needs a username and a password"), | |
402 => array("title" => "Payment Required", "desc" => "You can not use this code yet"), | |
403 => array("title" => "Forbidden", "desc" => "Access is forbidden to the requested page"), | |
404 => array("title" => "Not Found", "desc" => "The server can not find the requested page"), |
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
/* js else if with ternary operators | |
* http://verens.com/2010/07/21/javascript-compression-tip/#comments | |
*/ | |
function getValueFor(data){ | |
return firstCondition(data) | |
?1 | |
:secondCondition(data) | |
?2 | |
:thirdCondition(data) |
NewerOlder