Skip to content

Instantly share code, notes, and snippets.

View aaronbeall's full-sized avatar

Aaron Beall aaronbeall

View GitHub Profile
Inferred type of "plotOptions.cmf.params.volumeSeriesID" as {string} from default value {"volume"}
Inferred type of "plotOptions.macd.groupPadding" as {number} from default value {0.1}
Inferred type of "plotOptions.macd.minPointLength" as {number} from default value {0}
Inferred type of "plotOptions.macd.pointPadding" as {number} from default value {0.1}
Inferred type of "plotOptions.vbp.dataLabels.style.fontSize" as {string} from default value {"7px"}
Inferred type of "plotOptions.vbp.crisp" as {boolean} from default value {true}
Inferred type of "plotOptions.vbp.pointPadding" as {number} from default value {0}
Inferred type of "plotOptions.bellcurve.intervals" as {number} from default value {3}
Inferred type of "plotOptions.bellcurve.pointsInInterval" as {number} from default value {3}
Inferred type of "plotOptions.series.label.style.fontWeight" as {string} from default value {"bold"}
// Based on: https://api.highcharts.com/highcharts/tree.json
type Schema = { _meta: SchemaMeta; } & Defs;
interface SchemaMeta {
commit: string;
branch: string;
version: string;
date: string;
}
@aaronbeall
aaronbeall / SnapSVGAnimator.d.ts
Created December 8, 2017 17:13
[WIP] SnapSVG-Animator TypeScript definitions
// From: https://github.com/cjgammon/SnapSVG-Animator/wiki/API
declare class SVGAnim {
public linkage: object;
public mc: MovieClip;
public s: Snap.Element;
public resourceManager: any;
constructor(json: any, width: string | number, height: string | number, fps: string | number);
}
// ---------- webpack.config.ts ---------- //
import * as path from "path";
import * as webpack from "webpack";
import * as loaders from "./webpack/loaders";
import { plugins } from "./webpack/plugins";
const config: webpack.Configuration = {
entry: {
app: './src/index.tsx',
styleguide: './styleguide/index.tsx'
@aaronbeall
aaronbeall / sortOn.ts
Created November 8, 2017 20:05
TypeScript array sortOn key
function sortOn<T>(array: T[], ...fields: (keyof T)[]) {
return array.sort((a, b) => {
for (const f of fields) {
if (a[f] > b[f]) return 1;
if (a[f] < b[f]) return -1;
}
return 0;
});
}
@aaronbeall
aaronbeall / node-colorize-console.ts
Last active November 13, 2017 17:48
TypeScript NodeJS colorized console output
// Colors: https://coderwall.com/p/yphywg/printing-colorful-text-in-terminal-when-run-node-js-script
const {log, error, warn, info, debug} = console;
console.error = (...args: any[]) => _console.error("\x1b[31m", ...args, "\x1b[0m") // red
console.warn = (...args: any[]) => _console.warn("\x1b[33m", ...args, "\x1b[0m") // yellow
console.info = (...args: any[]) => _console.info("\x1b[34m", ...args, "\x1b[0m") // blue
console.debug = (...args: any[]) => _console.debug("\x1b[2m", ...args, "\x1b[0m") // dim
// extras
declare global {
interface Console {