Skip to content

Instantly share code, notes, and snippets.

View paustint's full-sized avatar
🏠
Working from home

Austin Turner paustint

🏠
Working from home
View GitHub Profile
@paustint
paustint / Dockerfile
Created May 21, 2020 15:44
Deploy zip to Heroku with GitHub Action
FROM alpine
RUN apk add --no-cache curl jq
@cecilemuller
cecilemuller / launch.json
Last active April 4, 2025 13:08
Run ts-node in VSCode Debugger
{
"version": "0.2.0",
"configurations": [
{
"name": "Example",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
@ljharb
ljharb / array_iteration_thoughts.md
Last active April 15, 2025 03:33
Array iteration methods summarized

Array Iteration

https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu

QUERY ::= 'SELECT' ('COUNT()' | (FIELD ( ',' FIELD)*))
'FROM' (NAME ('AS' ? NAME)? ('USING' NAME)?) ( ',' NAME ('AS' ? NAME)? ('USING' NAME)?)*
('WHERE' CONDITIONEXPR )?
('ORDER BY' ORDERBYEXPR)?
('LIMIT' POSINTEGER )?
FIELD ::= NAME | '(' QUERY ')'
CONDITIONEXPR ::= ANDEXPR | OREXPR | NOTEXPR | SIMPLEEXPR
ANDEXPR ::= 'AND' SIMPLEEXPR
OREXPR ::= 'OR' SIMPLEEXPR
NOTEXPR ::= 'NOT' SIMPLEEXPR
@subfuzion
subfuzion / mongoose-cheatsheet.md
Created February 26, 2014 19:03
mongoose cheatsheet

Definitely not comprehensive. This is meant to be a basic memory aid with links to get more details. I'll add to it over time.

Install

$ npm install mongoose --save

Connect

const mongoose = require('mongoose');