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
***Issue the following commands in the terminal after logging in with 'psql' | |
***If you copy paste, note that the new user will be 'new_user' with password 'mysupercoolpassword' | |
***with database 'new_database' and table 'new_table': | |
CREATE ROLE new_user WITH LOGIN PASSWORD 'mysupercoolpassword'; | |
CREATE DATABASE new_database; | |
GRANT ALL PRIVILEGES ON DATABASE new_database TO new_user; | |
\connect new_database; | |
CREATE TABLE new_table(id int, some_string varchar, cool_big_int bigint, PRIMARY KEY (id)); | |
GRANT ALL PRIVILEGES ON TABLE new_table TO new_user; |
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
{ | |
"companies": [{ | |
"symbol": "MMM", | |
"name": "3M Company" | |
}, { | |
"symbol": "ABT", | |
"name": "Abbott Laboratories" | |
}, { | |
"symbol": "ABBV", | |
"name": "AbbVie Inc." |
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
[ | |
{ | |
"Country": "Afghanistan", | |
"iso_alpha_2": "AF", | |
"iso_alpha_3": "AFG", | |
"iso_un_m49": "004" | |
}, | |
{ | |
"Country": "Aland Islands", | |
"iso_alpha_2": "AX", |
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
'use strict'; | |
const http = require('http'); | |
const express = require('express'); | |
const path = require('path'); | |
const app = express(); | |
let server; | |
app.use('/', express.static('./build')); |
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
FROM ubuntu:16.04 | |
# Ubuntu 16.04 ships with Python 3.5 as default. We should install and use python 3.7 to use the newest Django version (3.0.4 as of March 2020) | |
# We also need the python3.7-dev package in order for mod_wsgi-standalone to read the headers which are specific to 3.7.7 | |
RUN apt install -y software-properties-common | |
RUN add-apt-repository -y ppa:deadsnakes/ppa | |
RUN apt update | |
RUN apt install -y python3.7 | |
RUN apt install -y python3.7-dev | |
# Update the simlink of our 'python3' command |
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
// partial.js - partially evaluate a function | |
// taken from https://egghead.io/lessons/react-pass-data-to-event-handlers-with-partial-function-application | |
// usage: | |
// const addTwo(a, b) => a + b; | |
// const partialAddTwo = partial(addTwo, 10); | |
// const sum = partialAddTwo(5); | |
// console.log(sum); | |
// 15 | |
export const partial(fn, ...args) => fn.bind(null, ...args); |
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
// pipe.js - execute as many functions as needed in series | |
// from https://egghead.io/lessons/react-create-a-pipe-function-to-enable-function-composition | |
// usage: | |
// const addTwo = (a, b) => console.log(a + b); | |
// const addThree = (a, b, c) => console.log(a + b + c); | |
// pipe(addTwo(1, 2), addThree(3, 4, 5)); | |
// 3 | |
// 12 | |
const combine = (f, g) => (...args) => g(f(...args)); | |
export const pipe = (...fns) => fns.reduce(combine); |
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
pipelines: | |
branches: | |
master: | |
- step: | |
name: Our Very First Pipeline! | |
script: | |
- echo "Hello World!" |
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
pipelines: | |
branches: | |
master: | |
- step: | |
name: Our Very First Pipeline! | |
script: | |
- echo "Hello World!" |
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
pipelines: | |
branches: | |
master: | |
- step: | |
name: Install npm modules with npm install and build production site via tsc | |
script: | |
- npm install | |
- npm run build |
OlderNewer