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 elements = []; | |
const element = { | |
a: 3, | |
b: true, | |
c: [1,2,3], | |
d: {}, | |
e: null, | |
f: undefined, | |
xxx: "asdf" | |
}; |
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
-- pokemon.csv | |
/* | |
SELECT *, 'XX:' || SUBSTR(disappear_time, 15, 5) as time FROM pokemon ORDER BY disappear_time DESC; | |
*/ | |
-- spawnpoint_count.csv | |
/* | |
SELECT * FROM ( | |
SELECT spawnpoint_id, latitude, longitude, COUNT(*) as count FROM pokemon GROUP BY spawnpoint_id | |
) ORDER BY count DESC; |
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
if (!Number.prototype.isBetween) { | |
Number.prototype.isBetween = function (low, high) { | |
if (isNaN(this)) { | |
throw new Error('Invalid Number: ' + this); | |
} | |
if (isNaN(low) || isNaN(high)) { | |
throw new Error('Invalid Parameter Types: ' + low + ', ' + high); | |
} |
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
// checks if an array contains a specific object | |
Array.prototype.contains = function(obj) { | |
var i = this.length; | |
while (i--) { | |
if (this[i] === obj) { | |
return true; | |
} | |
} | |
return false; | |
}; |
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
var text = 'Some bla bla with #hashtags inside. ## and #this# works too but # and this# not.'; | |
var regex = new RegExp('\\B#([^\\s]+)', 'gm'); | |
var hashtags = text.match(regex); |