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
[ | |
{ | |
"id": 2, | |
"name": "analytics" | |
}, | |
{ | |
"id": 3, | |
"name": "cluster", | |
"parent": 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
#!/usr/bin/env bash | |
# fetch_nike_puls_all_activities.bash | |
# A simple bash script to fetch all activities and metrics from NikePlus. | |
# See `nike_plus_api.md` for the API details. | |
readonly bearer_token="$1" | |
if [[ -z "$bearer_token" ]]; then | |
echo "Usage: $0 bearer_token" | |
exit |
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
var groupAnagrams = function(strs) { | |
var res = {}; | |
var str = ''; | |
var len = strs.length; | |
for (var i = 0; i < len; i++) { | |
str = Array.from(strs[i]).sort().join(''); | |
if (!res[str]) res[str] = []; | |
res[str].push(strs[i]); | |
} | |
return Object.values(res); |
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
var threeSum = function(nums) { | |
let sortedNums = nums.sort((a,b) => a -b); | |
let numsLen = nums.length; | |
let start = 0; | |
let end = 0; | |
let res = []; | |
for (let i = 0; i < nums.length; i++) { | |
if (i > 0 && nums[i] === nums[i - 1]) continue; | |
start = i + 1; | |
end = nums.length - 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
for (let i= arr.length-1; i >= 0; i--) { | |
// itterate | |
} |
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
for (let i= 0; i < arr.length; i++) { | |
// itterate | |
} |
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
JS Escape Characters | |
\' — Single quote | |
\" — Double quote | |
\\ — Backslash | |
\b — Backspace | |
\f — Form feed | |
\n — New line | |
\r — Carriage return | |
\t — Horizontal tabulator | |
WebsiteSetup.org - Beginner’s Javascript Cheat Sheet 7 |
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
// boolean literal | |
let bad = false; | |
// boolean constructor | |
const myBad = new Boolean(false); |
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
// string literal | |
const stringLit = "It's Lit!"; | |
// string constructor | |
const stringCon = new String("A String object"); |
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
// number literal | |
const numLit = 123; | |
// number constructor | |
const numCon = new Number(123); |
NewerOlder