Skip to content

Instantly share code, notes, and snippets.

View isnifer's full-sized avatar
🏠
Working from home

Anton Kuznetsov isnifer

🏠
Working from home
  • Spicy AI
  • Yerevan, Armenia
  • 19:12 (UTC +04:00)
View GitHub Profile
@isnifer
isnifer / .zshrc
Last active October 17, 2016 08:54
My own git shortcuts
alias gs="git status"
alias gc="git checkout"
alias gps="git push"
alias gpl="git pull -r"
alias gb="git checkout -b"
alias gm="git merge"
alias gd="git branch -D"
alias gf="git fetch"
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
alias httpie="python -m SimpleHTTPServer"
@isnifer
isnifer / docker.sh
Last active April 1, 2018 14:30
Docker useful commands
# 1. Remove all old containers by id
# -q prints just the container ids (without column headers)
# -f allows you to filter your list of printed containers (in this case we are filtering to only show exited containers)
docker rm $(docker ps -q -f status=exited)
# 2. Change DNS settings, it will help you when your ISP
# proxy all DNS requests to their local DNS-server
sudo nano /etc/default/docker
# Then change line to whatever you want
{
"auto_indent": true,
"bold_folder_labels": true,
"caret_extra_width": 2,
"color_scheme": "Packages/Colorcoder/Material-Theme (Colorcoded).tmTheme",
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
@isnifer
isnifer / FullNormalTable.jsx
Created December 9, 2015 16:43
react-popover with multiple targets
import React, { Component, PropTypes } from 'react';
import Popover from 'react-popover';
// Components
import { EditQuantity } from '../dropdowns';
export class FullNormalTable extends Component {
static contextTypes = {
store: PropTypes.object.isRequired
};
@isnifer
isnifer / lifecycle.js
Created November 29, 2015 11:25
The Life-Cycle of a Composite Component
/**
* ------------------ The Life-Cycle of a Composite Component ------------------
*
* - constructor: Initialization of state. The instance is now retained.
* - componentWillMount
* - render
* - [children's constructors]
* - [children's componentWillMount and render]
* - [children's componentDidMount]
* - componentDidMount
@isnifer
isnifer / manifest.md
Last active November 24, 2015 10:51
Concept of Foma future-version API example

Инстанс должен иметь не только список в виде массива невалидных полей, но и объект, где каждое поле представлено объектов, там есть:

  • fieldName
  • хэндлеры для редактирования состояния
  • список ошибок
  • текст подсказки
  • в каждом поле можно перезаписать тип валидации
import React, { Component } from 'react';
### [Задача в Jira](https://%YOUR_TASK_MANAGEMENT_TOOL_URL%/browse/FN-)

**Суть:**
**Решение:**
var gulp = require('gulp');
var less = require('gulp-less');
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
gulp.task('css', function () {
return gulp.src('less/main.less')
.pipe(less())
// THIS FCKING SOLUTION! FCK YEAH!
validators={[
{
validator(value, params) {
if (value) {
return Promise.resolve();
}
return Promise.reject(params.message);
},
params: {