Skip to content

Instantly share code, notes, and snippets.

View CGastrell's full-sized avatar

Christian Gastrell CGastrell

View GitHub Profile
#!/bin/env bash
echo "ok"
@CGastrell
CGastrell / modal-nightmare.js
Created February 1, 2017 05:40
descriptive user decision path with a modal and unsaved data confirmation nested confirm modal
click: function (event) {
event.stopPropagation()
this.form = new EditFormView({ model: this.model, availableCustomers: this.availableCustomers })
// the created form eliminates the class, dunno why
this.form.el.classList.add('form-horizontal')
const originalData = merge({}, this.form.data)
const modal = bootbox.form(
{
@CGastrell
CGastrell / git_branch.sh
Created August 20, 2018 16:12 — forked from dciccale/git_branch.sh
Bash script to get the current git branch and last commit
#!/usr/bin/env bash
# checks if branch has something pending
function parse_git_dirty() {
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo "*"
}
# gets the current git branch
function parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"