Skip to content

Instantly share code, notes, and snippets.

View voigt's full-sized avatar

Christoph Voigt voigt

View GitHub Profile
@voigt
voigt / gist:4275677
Created December 13, 2012 10:50
Replacing the -9999px hack
/* Replacing the -9999px hack */
.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
@voigt
voigt / gist:4976853
Created February 18, 2013 11:55
Installing bower fails even with root permissions.
Christoph-Voigts-MacBook-Pro:~ christophvoigt$ sudo npm install bower -g
Password:
npm http GET https://registry.npmjs.org/bower
npm http 304 https://registry.npmjs.org/bower
npm http GET https://registry.npmjs.org/tmp
npm http GET https://registry.npmjs.org/vows
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/archy
npm http GET https://registry.npmjs.org/async
@voigt
voigt / gist:5321005
Created April 5, 2013 17:17
JavaScript Classes
var Kasten = function () {
this.div = '.kasten1';
this.top = $(div).offset().top;
this.bottom = $(div).offset().top + $(div).height();
this.height = $(div).height();
};
Kasten.prototype.doCrazy = function () {
return this.top;
@voigt
voigt / gist:5336776
Created April 8, 2013 13:32
Sublime Text Config
{
"font_size": 15.0,
"ignored_packages":
[
"Vintage"
],
"rulers":
[
80
],
@voigt
voigt / JavaScript_Ressources.md
Last active December 16, 2015 08:09
A collection of ressources for learning JavaScript.
@voigt
voigt / gist:5416524
Created April 18, 2013 21:51
Function that checks Online/Offline Status of Client
function updateStatus () {
var textStaus = navigator.onLine ? "online" . "offline"
document.getElementById("status").innerHTML = textStatus;
if (navigator.onLine) {
document.body.classList.remove("offline");
} else {
document.body.classList.add("offline");
}
@voigt
voigt / gist:5425279
Created April 20, 2013 08:41
Get a benchmark time for a function
while (true) {
var start = Date.now();
benchmark();
var duration = Date.now() - start;
console.log(duration);
}
@voigt
voigt / gist:5435792
Created April 22, 2013 15:09
Rob Levin, who previously recorded a number of videos about using Yeoman and Bower is back with new new videos about how to use Yeoman with Backbone and RequireJS.
http://www.youtube.com/watch?v=QYzjfT78Ir8
http://www.youtube.com/watch?v=uuR6gpfspbA
http://www.youtube.com/watch?v=48S1WV0LNVU
https://www.youtube.com/watch?v=oB-ZWj1s4wk
@voigt
voigt / Web-dev Links.md
Created June 6, 2013 08:57
A list of links for common issues