This file contains hidden or 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/sh | |
# Configure your favorite diff program here. | |
#DIFF="/usr/bin/vimdiff" | |
DIFF="/usr/bin/opendiff" | |
# Subversion provides the paths we need as the sixth and seventh | |
# parameters. | |
LEFT=${6} | |
RIGHT=${7} |
This file contains hidden or 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
.highlight { border: 2px solid red; } |
This file contains hidden or 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 isElementInViewport (el) { | |
//special bonus for those using jQuery | |
if (typeof jQuery === "function" && el instanceof jQuery) { | |
el = el[0]; | |
} | |
var rect = el.getBoundingClientRect(); | |
return ( |
This file contains hidden or 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
Show hidden characters
{ | |
// -------------------------------------------------------------------- | |
// JSHint Configuration, Strict Edition | |
// -------------------------------------------------------------------- | |
// | |
// This is a options template for [JSHint][1], using [JSHint example][2] | |
// and [Ory Band's example][3] as basis and setting config values to | |
// be most strict: | |
// | |
// * set all enforcing options to true |
This file contains hidden or 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 ParseTweetText = function(text) { | |
// link | |
text = text.replace(/(http|https):\/\/\S+/gi, function(val) { | |
return '<a target="_blank" href="'+val+'">'+val+'</a>'; | |
}); | |
// user_name | |
text = text.replace(/@[A-Z0-9\-\_]+/gi, function(val) { | |
return '<a target="_blank" href="https://twitter.com/'+val.slice(1)+'">'+val+'</a>'; |
This file contains hidden or 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 | |
// sample script to return the server time in json output | |
header('Content-Type: application/json'); | |
date_default_timezone_set('US/Eastern'); //server time zone | |
echo '{ "server": "' . date('m-d-Y H:i:s') . '" }'; | |
?> |
This file contains hidden or 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
// sample - using a simple server timestamp; using jQuery JSON call | |
// Eastern Time | |
var REQ_ET = $.ajax({ | |
url: "/dev/us-time/now/et.php", | |
dataType: "json", | |
cache: true | |
}).done(function(data){ | |
window.CURRENT_TIME_ET = new CurrentTimer(new Date(data.server)); |
This file contains hidden or 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 render = function(id, val) { | |
document.getElementById(id).innerHTML = val; | |
}; | |
render("get-val-1", QueryParam.getVal("foo")); | |
render("get-all-1", | |
(function(){ |
This file contains hidden or 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 QueryParam = (function(){ | |
var App = function() { | |
}; | |
var Proto = App.prototype; | |
// get specific query param value | |
Proto.getVal = function(name) { |
This file contains hidden or 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
<div>dy : hr : mn : sec</div> | |
<div id="timer"></div> |
NewerOlder