Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Danny Lamb daniellmb

🎯
Focusing
Block or report user

Report or block daniellmb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am daniellmb on github.
  • I am daniellamb (https://keybase.io/daniellamb) on keybase.
  • I have a public key whose fingerprint is BA5A C5A0 1FFA 602E FF54 DC4C 98AF D67C 1302 1D2A

To claim this, I am signing this object:

@daniellmb
daniellmb / calc-rem.js
Last active Jul 20, 2019
PX-to-REM Calculator
View calc-rem.js
(function($) {
var result = $('#result');
var base = $('#base');
var list = $('#list');
$('#calc').click(function() {
var baseVal = base.val();
var px = list.val().split(',');
var html = [];
$.each(px, function(i, v) {
var px = parseInt(v);
@daniellmb
daniellmb / anchor-style.css
Last active Feb 19, 2016
Dynamically inject heading links
View anchor-style.css
/* unobtrusively style deep-linking heading anchors */
.anchor {
color: gray;
display: inline-block;
margin-left: -1rem;
opacity: 0;
padding-right: 0.1rem;
-webkit-transition: opacity cubic-bezier(0,1,.35,.96) 1s;
-moz-transition: opacity cubic-bezier(0,1,.35,.96) 1s;
-ms-transition: opacity cubic-bezier(0,1,.35,.96) 1s;
@daniellmb
daniellmb / onerror.js
Last active Feb 25, 2016
Automagically look up JavaScript errors on Stack Overflow ;-)
View onerror.js
window.onerror = function(message) {
top.location.href = 'http://stackoverflow.com/search?q=' +
encodeURIComponent(message + ' [js]');
};
@daniellmb
daniellmb / Camelcase2Hyphencase.js
Created Apr 7, 2015
Convert Camelcase To Hyphencase In Just Seventy Bytes
View Camelcase2Hyphencase.js
'wowConvertCamelcaseToHyphencaseInJustSeventyBytes'.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase();
View closure_linter_error_numbers.py
# "File-fatal" errors - these errors stop further parsing of a single file
FILE_NOT_FOUND = -1
FILE_DOES_NOT_PARSE = -2
# Spacing
EXTRA_SPACE = 1
MISSING_SPACE = 2
EXTRA_LINE = 3
MISSING_LINE = 4
ILLEGAL_TAB = 5
@daniellmb
daniellmb / yield.js
Created Apr 11, 2013
Modernizr feature detection check for native yield support.
View yield.js
define(['Modernizr'], function( Modernizr ) {
// native yield support.
Modernizr.addTest('yield', (function(){try{yield;}catch(e){}}())!==undefined);
});
@daniellmb
daniellmb / classic.js
Last active Dec 14, 2015
Classic "Holy Grail" inheritance pattern using an immediate function to store the proxy.
View classic.js
var inherit = (function () {
var proxy = function () {};
return function (child, parent) {
proxy.prototype = parent.prototype;
child.prototype = new proxy();
child._super = parent.prototype;
child.prototype.constructor = child;
}
}());
You can’t perform that action at this time.