Skip to content

Instantly share code, notes, and snippets.

View jsguy's full-sized avatar

Mikkel Bergmann jsguy

View GitHub Profile
@jsguy
jsguy / gist:5981266
Last active December 19, 2015 16:08
SMH fix
<a href="javascript:void((function(){$('#subscription-overlay').remove();$('body').css({overflow: 'auto'}); localStorage.clear(); var a,b,c,e,f;f=0;a=document.cookie.split("; ");for(e=0;e<a.length&&a[e];e++){f++;for(b="."+location.host;b;b=b.replace(/^(?:%5C.|[^%5C.]+)/,"")){for(c=location.pathname;c;c=c.replace(/.$/,"")){document.cookie=(a[e]+"; domain="+b+"; path="+c+"; expires="+new Date((new Date()).getTime()-1e11).toGMTString());}}}})())">SMH fix</a>
// Nicely format a number as money, including germanic style - original from: http://stackoverflow.com/questions/149055/how-can-i-format-numbers-as-money-in-javascript
// eg: console.log(formatMoney(123456789.12345, ',', '.'));
var formatMoney = function(value, decimalPoint, thousandSeperator) {
var sign = value < 0 ? "-" : "",
number = parseInt(value = Math.abs(+value || 0).toFixed(2), 10) + "",
splitThousand = (splitThousand = number.length) > 3 ? splitThousand % 3 : 0;
decimalPoint = decimalPoint == undefined ? "." : decimalPoint;
thousandSeperator = thousandSeperator == undefined ? "," : thousandSeperator;
@jsguy
jsguy / index.html
Created August 13, 2012 22:18
A web page created at CodePen.io.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- IF PEN IS PRIVATE -->
<!-- <meta name="robots" content="noindex"> -->
<!-- END -->
@jsguy
jsguy / index.html
Created August 13, 2012 22:18
A web page created at CodePen.io.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- IF PEN IS PRIVATE -->
<!-- <meta name="robots" content="noindex"> -->
<!-- END -->
@jsguy
jsguy / dabblet.html
Created June 16, 2012 01:05
Untitled
<div>
<p>Hello World?</p>
</div>
<script>
// Why can't Chrome see ths save?
setInterval(function() {
console.log('hello, is there anybody out there? Ya\'ll?');
}, 1000);
@jsguy
jsguy / dabblet.html
Created June 16, 2012 01:03
Untitled
<div>
<p>Hello World?</p>
</div>
<script>
// Why can't Chrome see ths save?
setInterval(function() {
console.log('hello, is there anybody out there? Ya\'ll?');
}, 1000);
{"js":["http://code.jquery.com/jquery-git.js","http://code.jquery.com/jquery-1.6.4.js","http://cdn.sencha.io/ext-4.0.7-gpl/ext-all.js","http://ajax.googleapis.com/ajax/libs/ext-core/3.1.0/ext-core-debug.js","http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js","http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.5.3/modernizr.min.js","http://www.test.com/my.js"],"css":["http://www.test.com/my.css"]}
{"js":["http://code.jquery.com/jquery-git.js","http://code.jquery.com/jquery-1.6.4.js","http://ajax.googleapis.com/ajax/libs/ext-core/3.1.0/ext-core-debug.js","http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js","http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.5.3/modernizr.min.js","http://www.test.com/my.js"],"css":["http://www.test.com/my.css"]}
{"js":["http://code.jquery.com/jquery-git.js","http://code.jquery.com/jquery-1.6.4.js","http://ajax.googleapis.com/ajax/libs/ext-core/3.1.0/ext-core-debug.js","http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js","http://www.test.com/my.js"],"css":["http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.5.3/modernizr.min.js","http://www.test.com/my.css"]}
@jsguy
jsguy / dittor.external.js
Created May 2, 2012 08:21
title goes here yo!
{"js":["http://code.jquery.com/jquery-1.6.4.js","http://ajax.googleapis.com/ajax/libs/ext-core/3.1.0/ext-core-debug.js","http://www.test.com/my.js","http://code.jquery.com/jquery-git.js"],"css":["http://www.test.com/my.css"]}