🏳️🌈
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 mongoose = require("mongoose"); | |
var wascally = require("wascally"); | |
var AWS = require("aws-sdk"); | |
var some = require("some-thing"); | |
var other = require("other-thing"); | |
var more = require("more-things"); | |
mongoose.connect(connStr, function(err)( | |
if (err) { throw err; } | |
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
[url "https://github.com/"] | |
insteadOf = git://github.com/ |
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 obj = { | |
get foo(){ | |
return this._foo; | |
}, | |
set foo(val){ | |
this._foo = val; | |
} |
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
FileSchema.method("getDownloadUrl", (cb) => { | |
var options = { | |
Bucket: "watchmecode-net", | |
Key: this.name // <= "this" right here, points at the wrong thing!!! | |
}; | |
var s3 = new AWS.S3(); | |
s3.getSignedUrl("getObject", options, cb); | |
}) |
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
// initial set created from array | |
var mySet = new Set([1, 2, 3, 2, 4, 1, 3, 5]); | |
// add more items | |
mySet.add(1); | |
mySet.add(3); | |
// see what it holds | |
console.log(mySet); // => Set { 1, 2, 3, 4, 5 } |
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
$(".edit-button").on("click", (e) => { | |
someThing.doSomeWork(); | |
}); |
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 _0x167d=["\x61","\x62","\x66\x20\x3A\x20","\x67"];function C(_0x5ed1x2){var _0x5ed1x3=0;this[_0x167d[0]]=function(_0x5ed1x4){_0x5ed1x3++;alert(_0x5ed1x2+_0x5ed1x4);};this[_0x167d[1]]=function(){return _0x5ed1x3};}var obj= new C(_0x167d[2]);obj[_0x167d[0]](_0x167d[3]); |
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
someFunction( (arg1, arg2, argN) => { | |
// function body | |
}); |
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
{ | |
start: new Date("January 2, 2003"), | |
end: new Date("March 12, 2006") | |
} |
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
// this function takes an array of date ranges in this format: | |
// [{ start: Date, end: Date}] | |
// the array is first sorted, and then checked for any overlap | |
function overlap(dateRanges){ | |
var sortedRanges = dateRanges.sort((previous, current) => { | |
// get the start date from previous and current | |
var previousTime = previous.start.getTime(); | |
var currentTime = current.start.getTime(); |