Skip to content

Instantly share code, notes, and snippets.

View kulakowka's full-sized avatar

Anton Kulakov kulakowka

  • Tbilisi, Georgia
View GitHub Profile

Automatically Prepend a Jira Issue ID to Git Commit Messages

Use a git hook to match a Jira issue ID from the current branch, and prepend it to every commit message

Assuming the current branch contains a Jira issue ID, you can use a git hook script to prepend it to every commit message.

  1. Create an empty commit-msg git hook file, and make it executable. From your project's root directory:

     install -b -m 755 /dev/null .git/hooks/commit-msg
    
  2. Save the following script to the newly-created .git/hooks/commit-msg file:

// This is an example of how to fetch external data in response to updated props,
// If you are using an async mechanism that does not support cancellation (e.g. a Promise).
class ExampleComponent extends React.Component {
_currentId = null;
state = {
externalData: null
};
@kulakowka
kulakowka / gulpfile.js
Created October 15, 2015 19:04 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@kulakowka
kulakowka / gist:8c6e7fe5007256477752
Created October 15, 2015 18:38 — forked from navaru/gist:5779160
Textarea auto-resize vanilla javascript (no jQuery plugin), for modern browsers
;(function () {
function domReady (f) { /in/.test(document.readyState) ? setTimeout(domReady,16,f) : f() }
function resize (event) {
event.target.style.height = 'auto';
event.target.style.height = event.target.scrollHeight+'px';
}
/* 0-timeout to get the already changed text */
function delayedResize (event) {
window.setTimeout(resize, 0, event);
@kulakowka
kulakowka / git.css
Last active August 29, 2015 14:11 — forked from neilgee/git.css
/* Set up Git Configuration */
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git config --global core.editor "vi"
git config --global color.ui true