This file contains hidden or 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
/* 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 | |
*/ | |
/* |
This file contains hidden or 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
// 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; |
This file contains hidden or 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
component { | |
variables.sourceFiles = []; | |
variables.componentPaths = []; | |
variables.verbose = true; | |
variables.updated = 0; | |
public function run() { | |
var sourceFiles = findSourceFiles(); | |
sourceFiles.each(fixDottedPath); |
This file contains hidden or 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
<cfscript> | |
x = [ | |
"a":1, | |
"z":2, | |
"b":3 | |
]; | |
y = { | |
"a":1, |
This file contains hidden or 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
SELECT SUBSTRING_INDEX('1/2/3/4/500', '/', -1) AS last_element; |
This file contains hidden or 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
component extends="testbox.system.BaseSpec" { | |
function run(testResults, testBox) { | |
Feature("TestSuite", function() { | |
Given("I want to use TestBox", function() { | |
When("I run the TestSuite", function() { | |
Then("It should find and run tests", function() { | |
expect(true).toBeTrue(); |
This file contains hidden or 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
<cfscript> | |
// asked in cfml slack #cfml-beginners | |
function getNodePaths(xmldoc) { | |
var nodes = extractTextNodes(xmldoc); | |
var xPaths = []; | |
for (var node in nodes) { | |
xPaths.append(getXPath(node)); | |
} | |
return xPaths; |
This file contains hidden or 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
component { | |
function init(required query data){ | |
setQuery(arguments.data); | |
return this; | |
} | |
/* ---------------------------- PUBLIC ---------------------------- */ | |
/* --- Iterator methods ---------------------------- */ |
This file contains hidden or 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
component displayname="GIS Plant Asset Service" extends="app.model.services.baseService" accessors="true" { | |
property assetGateway; | |
public array function list() { | |
return populateBeans( "assetBean", assetGateway.select() ); | |
} | |
public array function getByAssetID ( required string assetid ) { | |
var data = assetGateway.select( { assetid : assetid } ); |
This file contains hidden or 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
SELECT * | |
FROM ( | |
SELECT uuid, | |
row_number() over (ORDER BY uuid) AS rn, | |
count(*) over () AS totalrows | |
FROM tblfoo | |
) AS tmp | |
WHERE rn BETWEEN 212201 AND 212210 | |
ORDER BY uuid | |
; |
NewerOlder