Skip to content

Instantly share code, notes, and snippets.

View dvdrtrgn's full-sized avatar
🐢
nibbling

David dvdrtrgn

🐢
nibbling
View GitHub Profile
#!/bin/bash -e
####
# Helper script to update the Last modified timestamp of files in a Git SCM
# Projects working Copy
#
# When you clone a Git repository, it sets the timestamp of all the files to the
# time when you cloned the repository.
#
# This becomes a problem when you want the cloned repository, which is part of a
# Web application have a proper cacheing mechanism so that it can re-cache files
@dvdrtrgn
dvdrtrgn / cfix-plus.js
Last active August 29, 2015 14:14
old IE fixer
Date.now = Date.now || function () {
return +new Date();
};
W.addEventListener = W.addEventListener || function (nom, fn) {
W.attachEvent('on' + nom, fn);
};
@dvdrtrgn
dvdrtrgn / base.css
Created April 19, 2009 19:44
Webapp-0
@media all {
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
body {
background-color: #eee;
color: #333 ;
font-size: 9pt ;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
}
@dvdrtrgn
dvdrtrgn / bakeoff.html
Created November 1, 2009 17:19
Misc html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
article, aside, figure, footer, header, hgroup,
@dvdrtrgn
dvdrtrgn / fix_ie6.js
Created November 1, 2009 17:23
HTML5 starter kit
document.createElement('header');
document.createElement('nav');
document.createElement('section');
document.createElement('article');
document.createElement('aside');
document.createElement('footer');
/*** OR ***/
//<script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
@dvdrtrgn
dvdrtrgn / Verbatim.xml
Created November 10, 2009 05:27
testing verbatim
<?xml version="1.0" encoding="utf-8"?>
<txtsrc>
<item author="Dune">
<title>Litany Against Fear</title>
<lines>
<line>I must not fear.</line>
<line>Fear is the mind-killer.</line>
<line>Fear is the little-death that brings total obliteration.</line>
<line>I will face my fear.</line>
<line>I will permit it to pass over me and through me.</line>
@dvdrtrgn
dvdrtrgn / clone.js
Created December 5, 2009 19:14
Array clone bakeoff
if (document.getElementById('hello')) {
document.getElementById('hello').innerHTML = 'Hello World - this was inserted using JavaScript';
}
var original_array = [],
dup_array;
for (var j = 0; j < 1500000; j++) {
original_array[j] = 9;
}
@dvdrtrgn
dvdrtrgn / lineate.js
Created January 2, 2012 18:40
object enumeration test
function lineate(obj){
var arr = [], i;
for (i in obj) arr.push([i,obj[i]].join(':'));
console.log(arr);
}
var obj = { a:1, b:2, c:3, "123":'xyz' };
/* log1 */ lineate(obj);
obj.a = 4;
/* log2 */ lineate(obj);
delete obj.a;
@dvdrtrgn
dvdrtrgn / Location.parse.js
Created February 16, 2012 18:43
extend Location to read or write a search string
location.parse = function () { //_qp_//
var i, e, arr, str = location.search,
out = new(function Queries() {});
if (!str || str.charAt(0) !== '?') {
return {};
}
arr = decodeURI(str.substr(1)).split('&'); // no '?'
for (i = 0; i < arr.length; i++) {
e = arr[i].split('=');
@dvdrtrgn
dvdrtrgn / ie tricks
Last active December 12, 2015 10:39
ie tricks
<!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.thrColHybHdr #sidebar1, .thrColHybHdr #sidebar2 { padding-top: 30px; }
.thrColHybHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
------------------------------------------------------------------------