Skip to content

Instantly share code, notes, and snippets.

View aos's full-sized avatar

aos

View GitHub Profile
@aos
aos / config-install.sh
Created January 2, 2018 18:41
Quick config install from github
# See here: https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/
git clone --bare https://github.com/aos/dotfiles.git $HOME/.cfg
function config {
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@
}
mkdir -p .config-backup
config checkout
if [ $? = 0 ]; then
echo "Checked out config.";
@aos
aos / relational.js
Created June 21, 2017 18:38
Relational Database Normalization
/* Relational (SQL) Database Normalization
Normalization:
- Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key. (3NF)
- Reduction and elimination of redundant data
- Example: A post in a blog, each post will have an author e-mail but if you needed to update the e-mail address of 'Andrew', you should only have to do it once (and not for each post).
Examples of un-normalized databases:
(https://en.wikipedia.org/wiki/Database_normalization)
@aos
aos / app.js
Created June 3, 2017 21:11
Recurse Center - Database Server for pair interview
// Database server using node and express
'use strict'
const express = require('express');
const app = express();
const db = {};
app.get('/set', (req, res) => {