Skip to content

Instantly share code, notes, and snippets.

View cmcculloh-kr's full-sized avatar

Christopher McCulloh cmcculloh-kr

View GitHub Profile
{
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
@cmcculloh-kr
cmcculloh-kr / branch-name-from-gus.js
Created November 21, 2018 20:36
Create a new git branch name from a GUS ticket
javascript: (function() {
let repoName;
let repoAuthor = document.querySelectorAll('#brandBand_1 .slds-form.slds-form_stacked.slds-grid.slds-page-header__detail-row .slds-page-header__detail-block.forceHighlightsDesktopListRecordItem:nth-of-type(6) a.textUnderline')[0].textContent;
let issueNumber;
if (document.querySelector('#brandBand_1 .slds-form.slds-form_stacked.slds-grid.slds-page-header__detail-row .slds-page-header__detail-block.forceHighlightsDesktopListRecordItem .uiOutputText') !== null) {
issueNumber = document.querySelector('#brandBand_1 .slds-form.slds-form_stacked.slds-grid.slds-page-header__detail-row .slds-page-header__detail-block.forceHighlightsDesktopListRecordItem .uiOutputText').textContent;
} else {
console.error('can not find issue number');
@cmcculloh-kr
cmcculloh-kr / staticDataTree.js
Created June 23, 2017 12:05
static data consuming tree
var findChildData = function findChildData (targetParent, rootData) {
if (_.isEmpty(targetParent)) {
return rootData;
}
if (rootData === undefined) {
return false;
}
for (var i = 0; i < rootData.length; i++) {
extends: ['eslint-config-airbnb'],
rules: {
'comma-dangle': [2, 'never'],
'id-length': [2, {
'min': 2,
'properties': 'never',
'exceptions': ['$', '_', 'e', 'i', 'j', 'a', 'b', 'n']
}],
'indent': [2, 'tab', {
'SwitchCase': 1
@cmcculloh-kr
cmcculloh-kr / branch-jira-bookmarklet.js
Last active November 1, 2023 14:07
Bookmarklet for creating Github branch names from JIRA tickets.
javascript: (function() {
const generateBranchName = () => {
const title = document.querySelector("title").innerText;
const issueCodeMatch = title.match(/\[(.*)\]/);
if (!issueCodeMatch) return;
let issueDescription = title.replace(/\[.*]\s/, "");
const parts = issueDescription.split(" - ");
issueDescription = parts.slice(0, parts.length - 1).join(" - ");
issueDescription = issueDescription.replace(/[^a-zA-Z0-9\s-]/g, '');
javascript: (function() {
let repoName;
if (document.querySelectorAll('.public .author').length !== 0) {
repoName = document.querySelectorAll('.public .author')[0].textContent;
} else if (document.querySelectorAll('.private .author').length !== 0) {
repoName = document.querySelectorAll('.private .author')[0].textContent;
}
let repoAuthor = document.querySelectorAll('.gh-header-meta .author')[0].textContent;
let issueNumber = document.querySelectorAll('.gh-header-number')[0].textContent;
{
"Profiles": [
{
"Badge Text" : "\\(user.gitBranch)",
"Working Directory" : "\/Users\/cmcculloh",
"Prompt Before Closing 2" : 0,
"Selected Text Color" : {
"Red Component" : 0.8866617679595947,
"Color Space" : "Calibrated",
"Blue Component" : 0.9910151958465576,
@cmcculloh-kr
cmcculloh-kr / GIF-Screencast-OSX.md
Last active July 8, 2016 19:15 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@cmcculloh-kr
cmcculloh-kr / expanded
Created April 27, 2016 16:25
Get branch from JIRA
// This is the expanded code for the bookmarklet.
// Use the minified code for the actual bookmarklet
javascript:(function() {
var title = jQuery('title').text();
var ticket = title.match(/\[(.*)]/);
var title_no_ticket = title.replace(/\[.*]\ /, '');
var title_no_suffix = title_no_ticket.replace(/\ \-\ ExactTarget\ JIRA/, '');
var title_cleaned = title_no_suffix.replace(/ \& /g, '_and_');
title_cleaned = title_cleaned.replace(/\&/g, '/');