This file contains hidden or 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
[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. |
This file contains hidden or 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
Fri Nov 24 14:59:11 UTC 2017 |
This file contains hidden or 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
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' }); | |
}); |
This file contains hidden or 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
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"); |
NewerOlder