Skip to content

Instantly share code, notes, and snippets.

@lucjan
lucjan / getWeek.js
Created November 11, 2012 21:47
Get a week in a year in JavaScript - ISO 8601
var getWeek=function(a){var b=new Date(a);return b.setDate(b.getDate()-(a.getDay()+6)%7+3),1+((b-new Date(b.getFullYear(),0,4))/864e5/7+1)|0}
@lucjan
lucjan / gd-page-developer-gist.html
Created October 25, 2012 14:06
GD website developer page gist
<script>
window.gdLoaded = function(gd) {
gd.init({
staticHost: 'https://static-files.globaldawn.com'
}).then(function() { /* your event handlers */ });
};
</script>
<script src="https://static-files.globaldawn.com/js/gd-sdk-bootstrap.js"></script>
@lucjan
lucjan / dabblet.css
Created February 16, 2012 15:07 — forked from anonymous/dabblet.css
Untitled
.first:hover + .second + .third {
color: red;
}
@lucjan
lucjan / gist:1583806
Created January 9, 2012 16:46
impress.coffee
((document, window) ->
pfx = (->
style = document.createElement("dummy").style
prefixes = "Webkit Moz O ms Khtml".split(" ")
memory = {}
(prop) ->
if typeof memory[prop] is "undefined"
ucProp = prop.charAt(0).toUpperCase() + prop.substr(1)
props = (prop + " " + prefixes.join(ucProp + " ") + ucProp).split(" ")
memory[prop] = null