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
/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, strict:true, undef:true, curly:true, browser:true, indent:2, maxerr:50 */ | |
/*! | |
front.js | |
(c) 2011 Anders Ytterström | |
front.js may be freely distributed under the MIT license. | |
TODO: pushState support | |
*/ | |
/* |
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
/*! | |
light-weight click listener, v 1.0 | |
Copyright (c) 2010 by madr <http://madr.se> | |
Licensed under the MIT license: http://en.wikipedia.org/wiki/MIT_License | |
*/ | |
/* | |
Usage: | |
Alter the below snippet for your needs and put the modified snippet in a js-file or a <script> and add it to your document. If your webapp depends on libraries or other resources to load, you better keep that in mind. | |
*/ | |
(function(document, undefined) { |
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 adate(daysFromNow) { | |
var date, datestr, mm, dd; | |
datestr = new Date().getTime(); | |
if (!!daysFromNow) { | |
datestr += (1000 * 60 * 60 * 24 * daysFromNow); | |
} | |
date = new Date(datestr); | |
mm = date.getMonth() + ''; | |
if (mm.length == 1) { | |
mm = '0' + mm; |
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
/* vertical ruler using pseudo-elements */ | |
@mixin columnseparator { | |
@extend .relative; | |
&:before { | |
content: ''; | |
position: absolute; | |
top: 0; | |
width: 3px; | |
background: #eee; |
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
/*jslint indent: 2 */ | |
var factorial = function (x) { | |
"use strict"; | |
var results = 1; | |
if (x === 0) { return results; } | |
results = x * factorial(x - 1); | |
return results; | |
}; |
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
/* | |
Thank you, almighty! | |
http://www.nczonline.net/blog/2011/10/11/simple-maintainable-templating-with-javascript/ | |
*/ | |
function sprintf(text){ | |
var i=1, args=arguments; | |
return text.replace(/%s/g, function(pattern){ | |
return (i < args.length) ? args[i++] : ""; | |
}); | |
} |
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
// ----------------------------------------------------------------- | |
// Image management helpers | |
// | |
// Returns `background` declarations in three modes: single, | |
// sprites, embed. | |
// | |
// * `single` will return the original image. This is default in | |
// dev mode. | |
// * `sprited` will return the images position on a already | |
// generated sprite map. |
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
# coding=utf-8 | |
from pymongo import Connection | |
# configuration | |
MONGODB_HOST = "localhost" | |
MONGODB_PORT = 27017 | |
MONGODB_DB = "guidenext" | |
def get_collection(name): | |
connection = Connection(MONGODB_HOST, MONGODB_PORT) |
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
/*jslint devel:true, browser:true, indent:2, maxlen: 70 */ | |
(function (window) { | |
"use strict"; | |
var Condition, Listener, watcher; | |
// Requires window.matchMedia: | |
// https://developer.mozilla.org/en/DOM/window.matchMedia | |
if (typeof window.matchMedia === "undefined") { return; } | |
Condition = function (mq, callback) { |
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
/* | |
By Anders Ytterström 2012. | |
Example use: | |
<script src="autocomplete.js"></script> | |
<script> | |
var values = ["Hansi", "Andre", "The Omen", "Marcus", "Prince Charles"], | |
callback = function (k) { | |
console.log(k); | |
}; |