Skip to content

Instantly share code, notes, and snippets.

🎩
‌‌

Daniel dan-lee

🎩
‌‌
Block or report user

Report or block dan-lee

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
@dan-lee
dan-lee / getAbsoluteHeight.js
Created Jun 19, 2018
Get absolute height of a DOM element
View getAbsoluteHeight.js
const getAbsoluteHeight = el => {
const computedStyle = window.getComputedStyle(el)
return Math.ceil(
el.offsetHeight +
parseInt(computedStyle.getPropertyValue('margin-top'), 10) +
parseInt(computedStyle.getPropertyValue('margin-bottom'), 10)
)
}
@dan-lee
dan-lee / spiegel-plus-deobfuscator.js
Last active Jan 27, 2018
Deobfuscate and hide paywall for SPIEGEL PLUS
View spiegel-plus-deobfuscator.js
let getReplacement = char =>
/[\s\n]/.test(char) ? char : String.fromCharCode(char.charCodeAt(0) - 1);
let deobfuscate = text =>
text
.trim()
.split('')
.reduce((prev, curr) => prev + getReplacement(curr), '');
View keybase.md

Keybase proof

I hereby claim:

  • I am dan-lee on github.
  • I am danlee (https://keybase.io/danlee) on keybase.
  • I have a public key ASB-wIoYlALYLZ_eR0FSy77P3T4XfYIR5tfjmu6cRJ1KTAo

To claim this, I am signing this object:

View libxml2.patch
--- ext/dom/node.c 2012-08-06 17:49:48.826716692 +0800
+++ ext/dom/node.c 2012-08-06 17:52:47.633484660 +0800
@@ -1895,9 +1895,17 @@ static void dom_canonicalization(INTERNA
RETVAL_FALSE;
} else {
if (mode == 0) {
+#ifdef LIBXML2_NEW_BUFFER
+ ret = xmlOutputBufferGetSize(buf);
+#else
ret = buf->buffer->use;
You can’t perform that action at this time.