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 / 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": {
export const authInterceptor = ({ dispatch }) => next => action => {
if (action.status === 401) {
Promise.resolve(dispatch(refreshToken()).then(() =>
next(action)
, (error) => {
console.log(error);
dispatch(logout());
}
));
} else {
{
"extends": "airbnb",
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"impliedStrict": false
}
@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() {
@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 / on-jsx.markdown
Created December 14, 2016 08:39 — forked from chantastic/on-jsx.markdown
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I lead the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can'