Skip to content

Instantly share code, notes, and snippets.

View noopnik's full-sized avatar

Nikita noopnik

View GitHub Profile
@noopnik
noopnik / git-branches-by-commit-date.sh
Created October 26, 2022 17:33 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# 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
@noopnik
noopnik / Docker shell commands.sh
Created March 19, 2020 16:36 — forked from bahmutov/Docker shell commands.sh
A personal cheat sheet for running local Node project in a Docker container
# 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 .
@noopnik
noopnik / fooapp.conf
Created December 7, 2016 17:25 — forked from DeadAlready/fooapp.conf
Nginx secure configuration
# 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;
@noopnik
noopnik / zemelya
Created July 9, 2018 09:18
zemelya
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) {
const EXTENSION_TYPE = {
0x01: 'PlainText',
0xF9: 'GraphicControl',
0xFE: 'Comment',
0xFF: 'Application'
};
/**
* Returns total length of data blocks sequence
*
@noopnik
noopnik / .eslintrc
Last active May 31, 2017 08:09
Webstrom + Eslint + Prettier Globals
{
"extends": [
"airbnb",
"prettier"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module",
"ecmaFeatures": {
{
"extends": "airbnb",
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"impliedStrict": false
}
export const authInterceptor = ({ dispatch }) => next => action => {
if (action.status === 401) {
Promise.resolve(dispatch(refreshToken()).then(() =>
next(action)
, (error) => {
console.log(error);
dispatch(logout());
}
));
} else {
@noopnik
noopnik / .eslintrc.js
Last active February 8, 2017 16:32
Eslintrc for React
{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"es6": true
},
"ecmaFeatures": {
"jsx": true,
"modules": true,
@noopnik
noopnik / Enhance.js
Created January 12, 2017 22:35 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {