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
#!/bin/bash | |
DIR_1="$1" | |
DIR_2="$2" | |
echo "Comparing directories ${DIR_1} <-> ${DIR_2}" | |
OLD_IFS=$IFS | |
for FILE_1 in `find ${DIR_1} -type f -printf '%P\n'` | |
do |
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
console.log(process.versions); | |
async function foo(msg) { | |
throw new Error(msg); | |
} | |
async function bar(msg) { | |
return foo(msg); | |
} |
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
import {Observable, of as observableOf} from 'rxjs'; | |
import {switchMap} from 'rxjs/operators'; | |
// THIS ONLY FAILS IN STRICT MODE | |
const foo: Observable<string | null> = observableOf('test').pipe( | |
switchMap(f => { | |
if(f) { | |
return observableOf([]); | |
} | |
return observableOf(null); |
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
let setIntervalCalls = 0; | |
const realSetInterval = global.setInterval; | |
global.setInterval = (...args) => { | |
setIntervalCalls++; | |
return realSetInterval(...args); | |
} | |
let clearIntervalCalls = 0; | |
const realClearInterval = global.clearInterval; | |
global.clearInterval = (...args) => { | |
clearIntervalCalls++; |
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 mongoose = require('mongoose'); | |
const personSchema = new mongoose.Schema({ | |
name: String, | |
friends: [{ | |
name: String | |
}] | |
}); | |
const Person = mongoose.model('Person', personSchema); |
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
// Global structure required by validate function | |
const validate = { | |
errors: null | |
}; | |
// Global formats required by validate function | |
const formats = { | |
date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, | |
'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i | |
}; |