Skip to content

Instantly share code, notes, and snippets.

@chrisbchoi
chrisbchoi / postgres.md
Created October 1, 2022 01:00 — forked from phortuin/postgres.md
Set up postgres + database on MacOS (M1)

Based on this blogpost.

Install with Homebrew:

$ brew install postgresql

Run server:

@chrisbchoi
chrisbchoi / maskDate.js
Created January 6, 2021 09:48 — forked from chrisjpatty/maskDate.js
Javascript date Input mask MM/DD/YYYY
const maskDate = value => {
let v = value.replace(/\D/g,'').slice(0, 10);
if (v.length >= 5) {
return `${v.slice(0,2)}/${v.slice(2,4)}/${v.slice(4)}`;
}
else if (v.length >= 3) {
return `${v.slice(0,2)}/${v.slice(2)}`;
}
return v
}
@chrisbchoi
chrisbchoi / aws-sns-example.js
Created September 26, 2020 08:19 — forked from tmarshall/aws-sns-example.js
aws-sdk sns example, in Node.js
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: '{AWS_KEY}',
secretAccessKey: '{AWS_SECRET}',
region: '{SNS_REGION}'
});
var sns = new AWS.SNS();