Skip to content

Instantly share code, notes, and snippets.

View grantcarthew's full-sized avatar
🙂
Coding

Grant Carthew grantcarthew

🙂
Coding
View GitHub Profile
@grantcarthew
grantcarthew / server.js
Last active April 11, 2019 00:57
medium-server.js
// server.js
const log = require('./logger').child(module)
const driver = require('./store/driver')
const app = require('./app')
const SERVERPORT = process.env.SERVERPORT
if (process.listeners('unhandledRejection').length < 1) {
process.on('unhandledRejection', (reason, promise) => {
console.error(reason)
process.exit(1)

CLI Improved

This document lists improvements over the default Linux command line tools.

The list was initially motivated by a blog post by Remy Sharp.

CLI Tools

Mongoose Code Snippets

Targeted Version: 5.1.6

Find Or Create

This will update the document on every call. Not the best option however it is atomic.

Ref: findOneAndUpdate

Keybase proof

I hereby claim:

  • I am grantcarthew on github.
  • I am grantcarthew (https://keybase.io/grantcarthew) on keybase.
  • I have a public key ASDuPrBqZ8grywTAt2TXnQyIDDnwMbV_uyu4ZK62K8GFggo

To claim this, I am signing this object:

@grantcarthew
grantcarthew / New-ACMEUser.csv
Last active October 22, 2019 12:19
Office 365 User Provisioning
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 15 columns, instead of 4. in line 8.
User Name,First Name,Last Name,Display Name,Job Title,Department,Office Number,Office Phone,Mobile Phone,Fax,Address,City,State or Province,ZIP or Postal Code,Country or Region
Porky,Porky,Pig,Porky Pig,Sidekick,ACME,12345,67890,1234567890,0987654321,4000 Warner Blvd,Burbank,CA,91522,USA
Daffy,Daffy,Duck,Daffy Duck,Bugs Bunny Sidekick,ACME,12345,67890,1234567890,0987654321,4000 Warner Blvd,Burbank,CA,91522,USA
Elmer,Elmer,Fudd,Elmer Fudd,Hunter,ACME,12345,67890,1234567890,0987654321,4000 Warner Blvd,Burbank,CA,91522,USA
Bugs,Bugs,Bunny,Bugs Bunny,Lead Character,ACME,12345,67890,1234567890,0987654321,4000 Warner Blvd,Burbank,CA,91522,USA
Tweety,Tweety,,Tweety,Cute Bird,ACME,12345,67890,1234567890,0987654321,4000 Warner Blvd,Burbank,CA,91522,USA
Sylvester,Sylvester,,Sylvester,Hungry Cat,ACME,12345,67890,1234567890,0987654321,4000 Warner Blvd,Burbank,CA,91522,USA
Yosemite,Yosmite,Sam,Yosmite Sam,Gun Slinger,ACME,12345,67890,1234567890,0987654321,4000 Warner Blvd,Burbank,CA,91522,USA
Foghorn,Foghorn,Leghorn,Forho
@grantcarthew
grantcarthew / settings.json
Last active November 29, 2018 03:26
VSCode Settings Backup
{
"workbench.colorTheme": "Solarized Light",
"workbench.editor.closeEmptyGroups": false,
"explorer.openEditors.visible": 0,
"explorer.autoReveal": false,
"editor.tabSize": 2,
"gitlens.advanced.messages": {
"suppressCommitHasNoPreviousCommitWarning": false,
"suppressCommitNotFoundWarning": false,
"suppressFileNotUnderSourceControlWarning": false,
@grantcarthew
grantcarthew / Projects.md
Last active March 13, 2017 04:56
GitHub Project of Interest

GitHub Projects of Interest

  • streama - It's like Netflix, but self-hosted!
  • redash - Make Your Company Data Driven. Connect to any data source, easily visualize and share your data.
  • eme - ✏️ Elegant Markdown Editor.
  • Emby - Emby Server is a personal media server with apps on just about every device.
  • roll-call - 📞 Free and reliable audio calls for everyone w/ browser p2p.
  • hubzilla - build community websites that can interact with one another.
  • nuclear - An Electron-based, multiplatform music player app that streams from multiple sources.
@grantcarthew
grantcarthew / Markdown Test.md
Last active October 3, 2020 03:27
GitHub Markdown Test Document

I use this Gist to test GitHub markdown format.

Cheat Sheet

[Mr Blobby]

Install-Module -Name <module name> -Force
@grantcarthew
grantcarthew / README.md
Last active August 27, 2015 23:50 — forked from zenorocha/README.md
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

{
"firstName": "John",
"lastName": "Smith",
"age": 25,
"address":
{
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": "10021"