Skip to content

Instantly share code, notes, and snippets.

@AlexanderTserkovniy
Last active October 8, 2015 10:39
Show Gist options
  • Save AlexanderTserkovniy/7415fb207593c669537b to your computer and use it in GitHub Desktop.
Save AlexanderTserkovniy/7415fb207593c669537b to your computer and use it in GitHub Desktop.
javascript: (function (log) {var name = jQuery('.ghx-issue-compact.ghx-selected .js-key-link, .ghx-issue.ghx-selected .js-key-link, .ghx-swimlane-header.ghx-selected .js-detailview').text(); var description = jQuery('.ghx-issue.ghx-selected .ghx-inner, .ghx-issue-compact.ghx-selected .ghx-inner').text(); var description = description || jQuery('.ghx-swimlane-header.ghx-selected .ghx-summary').contents().filter(function() {return this.nodeType === 3; }).text(); var transformed = {name: name.trim().toLowerCase(), description: description.trim().toLowerCase().replace(/[,\.\-\&'"]/g, '') }; var result = [transformed.name + '-' + transformed.description.split(' ').join('-'), name + ' ' + description ]; log(['git checkout -b ' + result[0] ].concat(result)); })(console.log.bind(console));
(function (log) {
var name = jQuery('.ghx-issue-compact.ghx-selected .js-key-link, .ghx-issue.ghx-selected .js-key-link, .ghx-swimlane-header.ghx-selected .js-detailview').text();
var description = jQuery('.ghx-issue.ghx-selected .ghx-inner, .ghx-issue-compact.ghx-selected .ghx-inner').text();
var description = description || jQuery('.ghx-swimlane-header.ghx-selected .ghx-summary').contents().filter(function() {
return this.nodeType === 3;
}).text();
var transformed = {
name: name.trim().toLowerCase(),
description: description.trim().toLowerCase().replace(/[,\.\-\&'"]/g, '')
};
var result = [
transformed.name + '-' + transformed.description.split(' ').join('-'),
name + ' ' + description
];
log([
'git checkout -b ' + result[0]
].concat(result));
})(console.log.bind(console));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment