Skip to content

Instantly share code, notes, and snippets.

View jeremiahlangner's full-sized avatar
👾

Jeremiah Langner jeremiahlangner

👾
View GitHub Profile
@jeremiahlangner
jeremiahlangner / client-bs-ss-plugin-1.js
Created September 14, 2017 16:26
client-bs-ss-plugin-1
// The majority of variables in this script are kept in the global scope for reuse. Except for styling, these elements are relatively universally applicable throughout most SquareSpace themes.
// Hide and count the image blocks. Give each image an easily identifiable unique id.
var els = document.getElementsByClassName('image-block');
var pageCount = 0;
[].forEach.call(els, function (el) {
pageCount++;
el.id = 'page-' + pageCount;
el.style.overflow = 'hidden';
el.style.display = 'none';
@jeremiahlangner
jeremiahlangner / client-bs-ss-plugin-2.html
Created September 14, 2017 16:28
client-bs-ss-plugin-2
<script>
/* Allow keyboard arrow-key based page-turns while lightboxed.
* Code: Jeremiah Langner; http://jeremiahlangner.me */
var images = document.getElementsByClassName("thumb-image");
window.onkeyup = function(e) {
var key = e.keyCode ? e.keyCode : e.which;
// User presses up key on keyboard.
(function() {
/* WIP for scraping table data from rendered Wikipedia and copying JSON to clipboard;*/
var headlineEls = document.getElementsByClassName('mw-headline');
var headlines = {};
[].forEach.call(headlineEls, function(headline, i) {
var headline = headline.innerHTML;
headlines[headline] = i;
});
var tables = document.getElementsByClassName('wikitable');
/*
This outer wrapper, the Name Space (I'm using older ES syntax; I may replace this later for
better clarification) is one point on which I am not so "certain"; but following Hebrew parallelism structures both sets of terms "without form and void" and "the face of the deep" consistent with completion or expansion of an idea. While in English at least "without form and void" would seem to indicate complete absence of substance or condition or total emptiness, the use of the terms "face of the deep" or "surface of the waters" implies pre-existing conditions. Viewing this first set of sentences within a synthetic parallel structure on a linguistic level would offer support for a reading of the first few verses according to an ancient Near Eastern cosmological perspective. I.e. both "without form and void" and "the face of the deep" imply "chaos" or "lack of meaning", thus it could be stated, as is linguistically literally consistent with the use of the Hebrew words for "made," that the process of "creation" des
@jeremiahlangner
jeremiahlangner / Observables.html
Last active January 23, 2019 21:36
Sticky JS issues, often used in code interviews. Use, memorize, steal from at your leisure.
<html>
<body>
<button id="add">+</button>
<span id="result">0</span>
<button id="subtract">-</button>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/6.3.3/rxjs.umd.min.js"></script>
<script>
/**
*
* Observables:
@jeremiahlangner
jeremiahlangner / define-property.ts
Last active September 1, 2023 17:01
Proxy Benchmarks
/*
Simple benchmark for Node.js proxies vs. Object.defineProperty
getter x 1,356,643,822 ops/sec ±0.09% (96 runs sampled)
proxy get x 12,188,540 ops/sec ±0.47% (90 runs sampled)
setter x 211,939,069 ops/sec ±3.95% (94 runs sampled)
proxy set x 10,336,783 ops/sec ±0.18% (95 runs sampled)
*/