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
# Credit http://stackoverflow.com/a/2514279 | |
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r |
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
# See list of docker virtual machines on the local box | |
$ docker-machine ls | |
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS | |
default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1 | |
# Note the host URL 192.168.99.100 - it will be used later! | |
# Build an image from current folder under given image name | |
$ docker build -t gleb/demo-app . |
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
# Remove server identifiers to help against enumeration | |
server_tokens off; | |
# Add some protection headers for ClickJacking | |
add_header X-Frame-Options DENY; | |
add_header X-Content-Type-Options nosniff; | |
# Redirect to https | |
server { | |
listen 80; |
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
var Worker = require('webworker-threads').Worker; | |
var promises = []; | |
var start = new Date(); | |
for (let worker = 0; worker < 4; worker++) { | |
var promise = new Promise((resolve, reject) => { | |
setTimeout(() => { | |
var fibo = new Worker(function() { | |
function fibonacci(num) { |
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
const EXTENSION_TYPE = { | |
0x01: 'PlainText', | |
0xF9: 'GraphicControl', | |
0xFE: 'Comment', | |
0xFF: 'Application' | |
}; | |
/** | |
* Returns total length of data blocks sequence | |
* |
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
{ | |
"extends": [ | |
"airbnb", | |
"prettier" | |
], | |
"parser": "babel-eslint", | |
"parserOptions": { | |
"ecmaVersion": 7, | |
"sourceType": "module", | |
"ecmaFeatures": { |
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
{ | |
"extends": "airbnb", | |
"parser": "babel-eslint", | |
"parserOptions": { | |
"ecmaVersion": 7, | |
"sourceType": "module", | |
"ecmaFeatures": { | |
"jsx": true, | |
"impliedStrict": false | |
} |
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
export const authInterceptor = ({ dispatch }) => next => action => { | |
if (action.status === 401) { | |
Promise.resolve(dispatch(refreshToken()).then(() => | |
next(action) | |
, (error) => { | |
console.log(error); | |
dispatch(logout()); | |
} | |
)); | |
} else { |
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
{ | |
"parser": "babel-eslint", | |
"env": { | |
"browser": true, | |
"node": true, | |
"es6": true | |
}, | |
"ecmaFeatures": { | |
"jsx": true, | |
"modules": true, |
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
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
NewerOlder