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
/** | |
* Given a sketch of how a set of classes should look and inherit, this | |
* returns a set of functions to be used as constructors for those | |
* classes. | |
* | |
* @param {Object} inheritance A JSON representation of the classes' | |
* inheritance, with each parent object | |
* containing the objects of its children, | |
* all keyed by name. |
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
// Folder prefix for file names if running from a different path than gulp | |
const fileNamePrefix = ""; | |
// Relies on an "input.txt" to exist in the same directory | |
// That "input.txt" should be a listing of just the tslint failures | |
const inputFileName = "input.txt"; | |
const fs = require("fs"); | |
const lines = fs |
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
console.log("Hello my darling"); | |
console.log("Hello my ragtime gaaaaaaal..."); |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>Test embed bug: Gists</title> | |
</head> | |
<body> | |
<iframe src="https://gist.github.com/jammur/97282dd0ff3696cc10e6a14a3b809cdd.pibb" style="width:700px;height:490px;" /> | |
</body> | |
</html> |
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
// Start showing a progress bar | |
NProgress.start(); | |
// Make the user think we're continuously making progress | |
const timer = setInterval(() => NProgress.inc(), 100); | |
// Send a network request, and when it's done, hide the bar | |
sendNetworkRequest().then(() => { | |
clearInterval(timer); | |
NProgress.stop(); |
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
// Start showing a progress bar | |
NProgress.start(); | |
// Tell the user whenever we make progress | |
requirejs.onResourceLoad = () => NProgress.inc()); | |
// Send a network request, and when it's done, hide the bar | |
sendNetworkRequest().then(() => { | |
NProgress.stop(); | |
delete requirejs.onResourceLoad; |
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 multiplyNumbersInString(source, constant) { | |
return source.replace(/((\d\.\d)|(\.\d)|\d)+/g, digit => digit * constant); | |
} |
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
// Start showing a progress bar | |
NProgress.start(); | |
// Remember how many resources have been requested | |
let completed = 0; | |
let oldPercentage = 0; | |
// Delay calculations so that if the first of a few resources has many dependencies, | |
// we don't immediately jump far in the progress bar before starting their loads | |
requirejs.onResourceLoad = context => { |
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
// Setup: npm install mocha chai chai-as-promised | |
// Run: node node_modules/mocha/bin/mocha | |
const chai = require("chai"); | |
const chaiAsPromised = require("chai-as-promised"); | |
const mocha = require("mocha"); | |
chai.use(chaiAsPromised); | |
const expect = chai.expect; |
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
succeed_CallsOnSuccess() { | |
// Arrange | |
const spy = sinon.stub(); | |
const actor = new Actor(spy); | |
// Act | |
actor.succeed(); | |
// Assert | |
UTF.Assert.True("onSuccess should have been called", spy.calledOnce); |
OlderNewer