Skip to content

Instantly share code, notes, and snippets.

View mmieluch's full-sized avatar

Michał Mieluch mmieluch

View GitHub Profile
@mmieluch
mmieluch / eslintrc.js
Last active November 10, 2018 17:03
ESLint configuration for Nuxt.js projects
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
extends: [
'standard',
'plugin:vue/recommended',
],
@mmieluch
mmieluch / .vimrc
Created January 17, 2019 11:35
My custom .vimrc
filetype plugin indent on
" show existing tab with 2 spaces width
set tabstop=2
" when indenting with '>', use 2 spaces width
set shiftwidth=2
" On pressing tab, insert 2 spaces
set expandtab
@mmieluch
mmieluch / git-hush
Created March 6, 2019 09:28
Add a `git hush` command. Takes filenames as arguments, but will not do any file stats check, instead will just redirect the filenames to `git update-index --assume-unchanged` command
#!/usr/bin/env node
const util = require('util')
const exec = util.promisify(require('child_process').exec)
const args = process.argv.slice(2)
if (!args.length) {
console.log('No filenames provided. Aborting!')
process.exitCode = 9
@mmieluch
mmieluch / git-unhush
Created March 6, 2019 09:30
`git unhush` command; takes optional filenames. If no filenames provided it will look for all files currently "assumed unchanged" in the repository and "unhush" them. The underlying Git command is `git update-index --no-assume-unchanged`
#!/usr/bin/env node
const util = require('util')
const exec = util.promisify(require('child_process').exec)
const args = process.argv.slice(2)
if (!args.length) {
console.log('No filenames provided. Aborting!')
process.exitCode = 9
@mmieluch
mmieluch / prepare-commit-msg
Last active May 1, 2019 15:20
Prepend commit message with JIRA issue ID
#!/usr/bin/env node
const fs = require('fs')
const { execSync } = require('child_process')
const msgFilePath = process.argv[2]
if (typeof msgFilePath !== 'string' && !msgFilePath.length) {
console.error('Commit message file not passed in from Git!')
process.exit(1)
}