View boot.sh
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
apt install -y debian-keyring debian-archive-keyring apt-transport-https | |
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo tee /etc/apt/trusted.gpg.d/caddy-stable.asc | |
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list | |
apt update | |
apt full-upgrade -y | |
apt install caddy |
View docker-compose.yaml
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
# inspiration | |
# https://dev.to/pfreitag/running-postgresql-in-docker-for-local-dev-2ojk | |
# https://medium.com/faun/managing-mongodb-on-docker-with-docker-compose-26bf8a0bbae3 | |
# https://rharshad.com/dynamodb-local-docker/ | |
# https://docs.fauna.com/fauna/current/integrations/dev.html#requirements | |
# instructions | |
# 1. start 'em up | |
# docker-compose up -d |
View pretty_log.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
console.log("%cPLS WORK!!!!","color: red; font-family:sans-serif; font-size: 20px"); | |
console.log("%cYAY it worked!","color: cyan; font-family:sans-serif; font-size: 24px"); |
View iterateOverEnum.ts
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
export enum EnumType { | |
choice = 'choice', | |
checkbox = 'checkbox', | |
boolean = 'boolean', | |
blank = 'blank', | |
match = 'match', | |
order = 'order' | |
} | |
export const getEnumTypeValues = (): { key: string; text: string }[] => |
View tsconfig.json
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
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "es2018", | |
"module": "commonjs", | |
"lib": ["ESNext", "ES2019", "es2018", "es2017", "es7", "es6", "dom"], | |
"declaration": true, | |
"outDir": "./dist", | |
"strict": false, | |
"esModuleInterop": true, | |
"resolveJsonModule": true, |
View app.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
import React, { Component } from 'react' | |
import firebase from 'firebase'; | |
export default class List extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
loaded: false, | |
data: {}, | |
}; |
View batchedSequentialPromiseAll.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
const waait = i => new Promise(res => setTimeout(() => { return res(i); }, 2000)); | |
const batchedPromiseAll = async (array) => { | |
let requests = array.slice(0); | |
let results = []; | |
let processBatch = async (chunks, results) => { | |
let curr; | |
try { |
View change_the_rest.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
class SomeClass extends Component { | |
onChange({ ...rest }) { | |
this.setState(rest); | |
}; | |
options = { | |
// ... | |
onChangePage: currentPage => this.onChange({ currentPage }), | |
onChangeRowsPerPage: numberOfRows => this.onChange({ numberOfRows }) | |
}; |
View .prettierrc
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
{ | |
"trailingComma": "es5", | |
"tabWidth": 2, | |
"semi": true, | |
"singleQuote": true, | |
"bracketSpacing": true, | |
"jsxBracketSameLine": true, | |
"arrowParens": "avoid", | |
"printWidth": 160 | |
} |
View CloudFormationExample.yaml
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
# Super simple example | |
Resources: | |
Ec2Instance: | |
Type: 'AWS::EC2::Instance' | |
Properties: | |
InstanceType: t2.micro | |
ImageId: ami-46ca739 # Amazon Linux AMI | |
# Update with a Tag | |
Tags: | |
- Key: Name |