k
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
bst=(r)-> | |
_root = r | |
compare=(a,b)-> | |
return switch | |
when a is b then 0 | |
when a < b then -1 | |
when a > b then 1 | |
root:()->_root |
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
<cffunction | |
name="QueryToCSV" | |
access="public" | |
returntype="string" | |
output="false" | |
hint="I take a query and convert it to a comma separated value string."> | |
<!--- Define arguments. ---> | |
<cfargument | |
name="Query" |
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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
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
const colors = 'red orange red yellow green blue yellow indigo violet red indigo orange green blue'; |
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
const colors = 'red orange red yellow green blue yellow indigo violet red indigo orange green blue'; | |
const colorsMapped = colors.split(' ').reduce((set, item, i) => { | |
if (item in set) return set; | |
// if the item isn't in the set, put it in and record its position | |
// don't do any mutations! | |
return { | |
...set, | |
[item]: i, |
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
/** | |
* one-line solution with sets! | |
*/ | |
const oneliner = [...new Set(colors.split(' '))].join(' '); | |
console.log(oneliner); | |
/** | |
* WHOAH! let's break that down! | |
*/ |
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
### Keybase proof | |
I hereby claim: | |
* I am jasonseminara on github. | |
* I am jasonseminara (https://keybase.io/jasonseminara) on keybase. | |
* I have a public key ASBbXJuctRaJZcwDrmK_S1uZfaw7bXhH3TMutfeL_h8hDwo | |
To claim this, I am signing this object: |
I hereby claim:
- I am jasonseminara on github.
- I am jasonseminara (https://keybase.io/jasonseminara) on keybase.
- I have a public key ASArAAJZqOZT7hFBOarI1dUNrD0g3FIvAOR0u-RudC7RiQo
To claim this, I am signing this object: