Skip to content

Instantly share code, notes, and snippets.

@aliaspooryorik
aliaspooryorik / Task.cfc
Created February 16, 2020 21:35
Fix case Task
component {
variables.sourceFiles = [];
variables.componentPaths = [];
variables.verbose = true;
variables.updated = 0;
public function run() {
var sourceFiles = findSourceFiles();
sourceFiles.each(fixDottedPath);
@aliaspooryorik
aliaspooryorik / axis-ticks.js
Last active February 27, 2020 12:14
Axis ticks based on range
// based on https://stackoverflow.com/questions/8855026/generate-axis-scale
function calculateTicks(min, max, tickCount) {
var span = max - min,
step = Math.pow(10, Math.floor(Math.log(span / tickCount) / Math.LN10)),
err = tickCount / span * step;
// Filter ticks to get closer to the desired count.
if (err <= .15) step *= 10;
else if (err <= .35) step *= 5;
else if (err <= .75) step *= 2;
@aliaspooryorik
aliaspooryorik / cheatsheet.ts
Last active June 21, 2023 08:35
Typescript Cheatsheet
/* eslint-disable no-console */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-inferrable-types */
/* eslint-disable no-unused-vars */
/*
WATCH: https://www.youtube.com/playlist?list=PLNqp92_EXZBJYFrpEzdO2EapvU0GOJ09n
*/
/*