Gloggy is a super simple (albiet terribly named) blogging system that runs on top of GitHub's Pages and Gists features.
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
globalThis.browser ??= globalThis.chrome; | |
let testCounter = 0; | |
let corsTest = async ( | |
{ | |
client: { | |
forcePreflight = false, | |
mode = undefined, | |
}, | |
server: { |
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
data:text/html, | |
<!-- See https://gist.github.com/svincent/699c0a9027bb6bc8298b076e638718f1/edit --> | |
<a id="link" title="Drag this link onto your bookmark bar to save!">save scratchpad</a> | |
<div id="editor" contenteditable>Type something here!<div>To save, drag the link in the top right onto your bookmark bar.</div></div> | |
<style> | |
:root { | |
--line-height: 1.5em; | |
} | |
* { |
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 fs = require('fs'); | |
var path = require('path'); | |
var parentModulePath = path.dirname(module.parent.filename); | |
// Recursively traverse up a given path tree checking for a file's existence. | |
function rstat(dir, filename, endPath) { | |
// End the search at endPath if provided, otherwise default to root | |
endPath = endPath || path.resolve('/'); | |
var target = path.join(dir, filename); |
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() { | |
console.log("You're the best around"); | |
console.log("Nothing's ever gonna keep you down"); | |
})() |
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 buildApply() { | |
var args = Array.prototype.slice.call(arguments, 0); | |
var fn = args.shift(); | |
// proxy function | |
return function bindProxy() { | |
var proxyArgs = Array.prototype.slice.call(arguments, 0); | |
return fn.apply(null, args.concat(proxyArgs)); | |
} | |
} |
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 getPushIdTimestamp = (function getPushIdTimestamp() { | |
var PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; | |
return function getTimestampFromId(id) { | |
var time = 0; | |
var data = id.substr(0, 8); | |
for (var i = 0; i < 8; i++) { | |
time = time * 64 + PUSH_CHARS.indexOf(data[i]); | |
} |
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 deps = require('./getModuleDeps'); | |
console.table(deps('myModule')); | |
/* Example output (ASCII-fied) | |
-------------------------------------------------------------- | |
| (index) | provider | type | name | | |
|---------|--------------------|-------------|---------------| | |
| 0 | "$compileProvider" | "directive" | "myDirective" | |
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 List () {} | |
List.prototype = [] | |
List.prototype.constructor = List | |
List.prototype._return = function _return (val) { | |
if (val.length <= 1) | |
val = val[0] | |
return val | |
} |
NewerOlder