Skip to content

Instantly share code, notes, and snippets.

View bartdorsey's full-sized avatar

Bart Dorsey bartdorsey

View GitHub Profile
@bartdorsey
bartdorsey / vscode-extensions.md
Created September 29, 2020 22:38
VSCode Extentions I find to be valuable for JavaScript development
@bartdorsey
bartdorsey / dev-environment.yml
Created August 12, 2021 23:49
Cloudformation YAML for an Ubuntu 20.04 dev environment with the free tier on AWS and SSH access.
AWSTemplateFormatVersion: 2010-09-09
Description: EC2 based SSH dev environment for VSCode Remote SSH
Parameters:
Key:
Type: String
Description: The name of your amazon EC2 security key
Resources:
DevEnvironmentSubnet:
Type: 'AWS::EC2::Subnet'
Properties:
@bartdorsey
bartdorsey / install.ps1
Last active August 31, 2021 22:10
Windows Development Boxstarter Script
Write-Host @'
=============================
< Windows Subsystem for Linux >
< (Ubuntu >= 20.04) installer >
=============================
\
\
.--.
|o_o |
|:_/ |
@bartdorsey
bartdorsey / useAsyncEffect.js
Last active September 15, 2021 20:33
useAsyncEffect - Like useEffect but without an Async IIFE
import { useEffect } from 'react';
export default function useAsyncEffect(callback, dependencies) {
useEffect(() => {
(async() => {
return await callback();
})();
}, dependencies);
}
@bartdorsey
bartdorsey / keybase.md
Created November 5, 2021 17:40
keybase.md

Keybase proof

I hereby claim:

  • I am bartdorsey on github.
  • I am bartdorsey (https://keybase.io/bartdorsey) on keybase.
  • I have a public key ASCEQoTmhwrzLjydn4UXu76n0dmQDT3j5-K_6B8fgwx_Awo

To claim this, I am signing this object:

@bartdorsey
bartdorsey / maketree.md
Last active September 16, 2022 15:25
Make Tree

Make Tree

This problem was inspired by a Fun Fun Function video: https://www.youtube.com/watch?v=k7-N8R0-KY4

Write a recursive function makeTree(categories, parent) that takes an array of categories objects, each of which have an id property, and a parent property and returns a nested tree of those objects using the parent properties to construct the tree.

@bartdorsey
bartdorsey / docker-compose.yml
Last active January 21, 2022 15:22
nginx-proxy-manager docker compose
version: '3'
services:
nginx-proxy:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
@bartdorsey
bartdorsey / nginx.conf
Last active January 21, 2022 15:22
nginx port 80 application server
upstream app_servers {
server app:4000;
}
server {
listen 80;
location / {
proxy_pass http://app:4000/;
}
@bartdorsey
bartdorsey / postgresql-tips.md
Last active September 16, 2022 15:24
PostgreSQL tips and tricks

PostgreSQL Tips and Tricks

Checking to see if PostgreSQL is running:

Running these commands should tell you if postgres is running or not.

Ubuntu Linux:

sudo service postgresql status
@bartdorsey
bartdorsey / short-video-ideas.md
Last active February 21, 2022 16:02
Short video ideas

Short video ideas

  • express-generator
  • starting postgresql automatically on WSL
  • create-react-app and templates
  • Sequelize Migration basics
  • Sequelize pretty logger
  • Native ESM in Node.JS
  • Reduce isn't just for summing numbers
  • Expressions vs Statements and JSX