Skip to content

Instantly share code, notes, and snippets.

View davidnguyen11's full-sized avatar
๐Ÿ‘‹

David Nguyen davidnguyen11

๐Ÿ‘‹
View GitHub Profile
@davidnguyen11
davidnguyen11 / HttpStatusCode.ts
Created April 8, 2020 06:54 — forked from scokmen/HttpStatusCode.ts
Typescript Http Status Codes Enum
"use strict";
/**
* Hypertext Transfer Protocol (HTTP) response status codes.
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
*/
enum HttpStatusCode {
/**
* The server has received the request headers and the client should proceed to send the request body
@davidnguyen11
davidnguyen11 / release.sh
Created December 9, 2019 01:34 — forked from adamreisnz/release.sh
A script to automate merging of release branches
#!/usr/bin/env bash
# Assuming you have a master and dev branch, and that you make new
# release branches named as the version they correspond to, e.g. 1.0.3
# Usage: ./release.sh 1.0.3
# Get version argument and verify
version=$1
if [ -z "$version" ]; then
echo "Please specify a version"
@davidnguyen11
davidnguyen11 / release.sh
Created December 9, 2019 01:34 — forked from adamreisnz/release.sh
A script to automate merging of release branches
#!/usr/bin/env bash
# Assuming you have a master and dev branch, and that you make new
# release branches named as the version they correspond to, e.g. 1.0.3
# Usage: ./release.sh 1.0.3
# Get version argument and verify
version=$1
if [ -z "$version" ]; then
echo "Please specify a version"

In this tutorial we're going to build a set of parser combinators.

What is a parser combinator?

We'll answer the above question in 2 steps

  1. what is a parser?
  2. and.. what is a parser combinator?

So first question: What is parser?

@davidnguyen11
davidnguyen11 / pgsql_backup.sh
Created March 19, 2018 11:31 — forked from sirbrillig/pgsql_backup.sh
Postgresql daily backup script.
#!/bin/bash
#
# Backup a Postgresql database into a daily file.
#
BACKUP_DIR=/pg_backup
DAYS_TO_KEEP=14
FILE_SUFFIX=_pg_backup.sql
DATABASE=
USER=postgres
@davidnguyen11
davidnguyen11 / introrx.md
Created September 21, 2017 05:24 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@davidnguyen11
davidnguyen11 / README.md
Created February 25, 2017 17:49 — forked from rgrove/README.md
Cake's approach to React Router server rendering w/code splitting and Redux

Can't share the complete code because the app's closed source and still in stealth mode, but here's how I'm using React Router and Redux in a large app with server rendering and code splitting on routes.

Server

  1. Wildcard Express route configures a Redux store for each request and makes an addReducers() callback available to the getComponents() method of each React Router route. Each route is responsible for adding any Redux reducers it needs when it's loaded. (This isn't really necessary on the