There's not a good, simple embeddable REPL for JS out there that I could find. I wanted one for presentations on JavaScript concepts. The developer tools' console would be ideal, but bailing out of my presentation and opening a console brakes the flow. Tools like codepen.io et al. are great, but more overhead and set up than I need. I just want to type JS and show the result. This is a decent first step for my needs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const numericalDirection = (arg, n = Number(arg)) => Math.abs(n) / n || 0 | |
export default numericalDirection; |
I hereby claim:
- I am uniqname on github.
- I am uniqname (https://keybase.io/uniqname) on keybase.
- I have a public key whose fingerprint is 4CC2 022E 189D 4A8D AA12 1AEC E307 96BD 29EE 6A01
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getPath = function (start, end) { | |
var getParents = function (el) { | |
var parents = [el]; | |
el = el.parentElement; | |
while (el.parentElement) { | |
parents.push(el = el.parentElement); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function (window, document, $, undefined) { | |
var module, moduleName, stash, unstash, noconflict, oldGlobal; | |
moduleName = 'infiniteStash'; | |
stash = function (containerNode, numNodesToStash, after) { | |
var side = (after === true || after === 'after') ? 'after' : 'before', | |
// set is uesd to stash all node up to the next element. | |
// This preserves text nodes (white space) and comment nodes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************* | |
* Custom siteName functionality | |
* window.location.siteName reduces a either the documents url or a | |
* given url to the top most site name. | |
* i.e. photography.nataionalgeographic.com would return nationalgeographic.com, | |
* mysubdomain.mywebsite.co.uk would return mywebsite.co.uk. | |
***********/ | |
if (typeof window.location.siteName === 'undefined') { | |
window.location.siteName = function (url) { | |
var hostName = url || window.location.hostname, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exposure = function () { | |
/* | |
RETURNS: An exposure URL which returns the specified image resized to specified height and width | |
ARGUMENTS: object || url:string [, height:string||int] [, width:string||int] | |
The exposure method takes either an object or one or more strings as arguments. | |
A value of "0" for "width" or "height" indicates that exposure should use a value | |
that maintains the image's native aspect ratio. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# top-most EditorConfig file | |
root = true | |
[*] | |
end_of_line = lf | |
insert_final_newline = true | |
charset = utf-8 | |
indent_style = space | |
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"registry": { | |
"register": "http://bower.ldschurch.org" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.3.14) | |
// Compass (v1.0.1) | |
// ---- | |
.full { | |
@each $pos in ("top", 'left', bottom, right) { | |
#{$pos}: 0; | |
} | |
} |
NewerOlder