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
| async function asyncForEach(array, callback) { | |
| for (let index = 0; index < array.length; index++) { | |
| await callback(array[index], index, array); | |
| } | |
| } | |
| // Usage: | |
| // await asyncForEach(myArray, async (element) => { | |
| // await someLongRunningOperation(element); | |
| // await someOtherLongRunningOp(element); |
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
| function rng (min, max) { | |
| var num = Math.random() * (max - min) + min; | |
| return Math.floor(num) | |
| } |
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
| async function sleep (ms) { | |
| return new Promise(resolve => setTimeout(resolve, ms)); | |
| } |
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
| /// <summary> | |
| /// Iterates through an object's properties and checks of any of them are null. | |
| /// </summary> | |
| public static bool AllPropertiesNullOrEmpty(this object theObject) | |
| { | |
| var propertiesNotNull = theObject.GetType() | |
| .GetProperties() | |
| .Select(pi => pi.GetValue(theObject)) | |
| .Any(value => value != null); |
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
| function Set-NamecheapDdnsRecord { | |
| <# | |
| .SYNOPSIS | |
| Update the IP address of a Dynamic DNS record in Namecheap. | |
| .EXAMPLE | |
| PS C:\> Set-NamecheapDdnsRecord -HostRecord www -Domain brianmorrison.me -ApiKey 12345678abcd -Ip 123.234.123.234 | |
| Updates the record for www.brianmorrison.me to 123.234.123.234 | |
| .NOTES | |
| Author: Brian Morrison II | |
| Date: 4/10/2019 |
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
| $MsolUser = Get-MsolUser -UserPrincipalName $Username | |
| $AssignedLicenses = $MsolUser.licenses.AccountSkuId | |
| foreach($License in $AssignedLicenses) { | |
| Set-MsolUserLicense -UserPrincipalName $Username -RemoveLicenses $License | |
| } | |
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
| // env.test file: | |
| // DB_HOST="localhost" | |
| // DB_PORT="27017" | |
| // DB_NAME="dbname" | |
| // DB_USER="dbusername" | |
| // DB_PASS="dbpassword" | |
| require('custom-env').env(true) | |
| const mongoose = require('mongoose') |
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
| const dynamoose = require('dynamoose'); | |
| let configUpdates = { | |
| region: "us-east-1", | |
| accessKeyId: 'key123', | |
| secretAccessKey: 'secret123' | |
| } | |
| dynamoose.AWS.config.update(configUpdates); |
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
| { | |
| "test-spec": "nodemon --exec \"mocha -c --reporter=spec --recursive \"src/**/*.spec.js\"\"" | |
| } |
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
| <template> | |
| <v-app> | |
| <v-navigation-drawer :value="isDrawerVisible" app clipped> | |
| <v-list class="pt-0"> | |
| <v-list-tile @click=""> | |
| <v-list-tile-action> | |
| <v-icon>dashboard</v-icon> | |
| </v-list-tile-action> | |
| <v-list-tile-content> |