docker ps
docker run -d -p 9000:80 nginx:latest
docker rm -f id-container
docker images
How I use sessions: | |
.env file (always in my .gitignore file so it never hits my public repos): | |
SECRET="This is my funky secret oh my god it has ninja turtles" | |
app.js: | |
var express = require('express'), | |
env = (function(){ | |
var Habitat = require("habitat"); |
SuperTest works with any test framework, here is an example without using any test framework at all: | |
const request = require('supertest'); | |
const express = require('express'); | |
const app = express(); | |
app.get('/user', function(req, res) { | |
res.status(200).json({ name: 'tobi' }); | |
}); |
Fri Nov 24 14:59:11 UTC 2017 |
[To delete all local branches that are already merged into the currently checked out branch:](https://stackoverflow.com/questions/6127328/how-can-i-delete-all-git-branches-which-have-been-merged) | |
```git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d``` | |
explain: | |
- git branch --merged: get all merged branch, this may include master or dev branch that you want to keep | |
- the second command, egrep -v, will look for all these branches and invert the search with a regular expression to search for master or dev branch | |
- all the results are listed on multiple lines, we need them as input parameters to the next command, we use xargs. The xargs utility reads space, tab, newline and end-of-file delimited strings from the standard | |
input and executes utility with the strings as arguments. | |
- then we can delete them with git branch -d as usual. |
$ brew install mongodb
$ brew services start mongodb
$
You can use Ctrl+U to clear up to the beginning.
You can use Ctrl+W to delete just a word.
You can also use Ctrl+C to cancel.
If you want to keep the history, you can use Alt+Shift+# to make it a comment.
The web is changing
You should have the following completed on your computer before the workshop:
yarn
with brew install yarn
.