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
/// <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 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 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 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 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 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 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> |
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
<template> | |
<div> | |
<prism language="json" :code="JSON.stringify(data, null, 4)"></prism> | |
</div> | |
</template> | |
<script> | |
import Prism from 'vue-prismjs' | |
import 'prismjs/themes/prism.css' |
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 AWS = require('aws-sdk'); | |
function putObjectToS3(bucket, key, data){ | |
return new Promise((resolve, reject) => { | |
let s3 = new AWS.S3(); | |
var params = { | |
Bucket : bucket, | |
Key : key, | |
Body : data | |
} |
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(process.env.ENVIRONMENT != "PROD") { | |
require('dotenv').config() | |
} | |
const express = require('express'); | |
const app = express(); | |
const bodyParser = require('body-parser'); | |
const morgan = require('morgan') | |
const routes = require('./routes') |