Skip to content

Instantly share code, notes, and snippets.

View constgen's full-sized avatar

Constantine Genchevsky constgen

View GitHub Profile
@constgen
constgen / jsconfig.json
Created May 16, 2017 20:58
Allow decorators in VSCode
{
"compilerOptions": {
"experimentalDecorators": true
}
}
@constgen
constgen / gist:383fbfa6ed8460b4da21d8c178e3f468
Last active June 24, 2017 15:51
Git ESLint precommit hook
#!/bin/zsh
function lintit () {
OUTPUT=$(git diff --name-only | grep -E '(.js)$')
a=("${(f)OUTPUT}")
e=$(eslint -c eslint.json $a)
echo $e
if [[ "$e" != *"0 problems"* ]]; then
echo "ERROR: Check eslint hints."
exit 1 # reject
@constgen
constgen / .stylelintrc
Last active July 8, 2017 11:34
Custom StyleLint config 7.12.0
{
"extends": "stylelint-config-standard",
"rules": {
"indentation": "tab",
"string-quotes": "single",
"no-duplicate-selectors": true,
"color-hex-case": "lower",
"color-hex-length": "short",
"selector-type-no-unknown": true,
"selector-no-qualifying-type": true,
@constgen
constgen / settings.json
Created August 2, 2017 09:41
Language specific VSCode config
{
"[javascript]": {
"editor.tabSize": 2,
"editor.insertSpaces": true
},
"[vue]": {
"editor.tabSize": 2,
"editor.insertSpaces": true
},
"eslint.options": {
@constgen
constgen / .eslintrc
Last active April 12, 2018 19:34
Custom ESLint config
{
"globals": {},
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
@constgen
constgen / app.js
Last active April 29, 2018 17:08
Koa2 with router and Hot Module Replacement
'use strict';
let Koa = require('koa');
let jsonBody = require('koa-json-body');
let router = require('./router');
let defaultErrorHandler = require('./default-error-handler');
module.exports = new Koa()
.use(defaultErrorHandler)
.use(jsonBody({ limit: '1mb', fallback: true, strict: true }))
@constgen
constgen / git-tag-delete-local-and-remote.sh
Created May 29, 2018 10:11 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@constgen
constgen / .travis.yml
Last active May 30, 2018 19:54
Travis GitHub release
language: node_js
node_js:
- "8.11"
install:
- npm install
cache:
directories:
- node_modules
script:
- npm test
@constgen
constgen / settings.json
Last active November 24, 2018 19:03
Files associations in VSCode
{
"files.associations": {
"*.vue": "vue",
".stylelintrc": "json"
}
}
@constgen
constgen / .gitignore
Created December 3, 2018 08:20
Git ignore
/.DS_Store
/package-lock.json
*.code-workspace
/build
/dist