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
/* TODO Must be hard-coded, change to fit your project */ | |
const IMPORT_META_GLOB = import.meta.glob("/src/content/*/*.md"); | |
const CONTENT_DIR = "/src/content"; // TPDP move to a config | |
const = CONTENT_DIR + "/*/*.md"; | |
const INDEX = "/index.md"; | |
export async function filterGlob(regexOrString) { | |
let regex = (regexOrString instanceof RegExp) ? regexOrString : new RegExp(regexOrString); |
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
import {add, subtract} from './modules/supermath.js'; | |
window.glue = { | |
doMath :function doSomething1(ida, idb, idop, idresult) { | |
let a = Number(document.getElementById(ida).value); | |
let b = Number(document.getElementById(idb).value); | |
let op = document.getElementById(idop).value; | |
let result = (op === '+') ? add(a,b) : subtract(a,b); | |
document.getElementById(idresult).value = result; |
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 mapy(object, andPrototype, andAssign) { | |
const _object = object; | |
let _mapy = { | |
keys() { return Object.keys(_object); }, | |
values() { return _it(true); }, | |
entries() { return _it(false); } | |
} | |
if (andPrototype) | |
Object.setPrototypeOf(_mapy, 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
package com.flyingspaniel.xen; | |
import java.util.Arrays; | |
import java.util.Comparator; | |
/** | |
* @author Morgan Conrad | |
* @see <a href="http://opensource.org/licenses/MIT">This software is released under the MIT License</a> | |
* @since Copyright (c) 2014 by Morgan Conrad | |
*/ |
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 Request = require('request/request.js'); // IMPORTANT - specify request.js, don't get index.js!!! | |
var querystring = require('querystring'); | |
MyRequest.prototype = Object.create(Request.prototype); | |
MyRequest.prototype.constructor = MyRequest; | |
function MyRequest(options, callbackfn) { | |
"use strict"; | |
if (callbackfn) | |
options.callback = callbackfn; |
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
module.exports = Foo; // just one line to get all of this code. | |
// Now how much would you pay? | |
/** constructor capital first letter to remind callers**/ | |
function Foo(args) { | |
if (!this instanceof Foo) // but callers do screw up... | |
return new Foo(args) // or, if you wish, throw something | |
this.useSoap = args.useSoap ; // define instance vars here |