Skip to content

Instantly share code, notes, and snippets.

View gburgett's full-sized avatar

Gordon gburgett

View GitHub Profile
@gburgett
gburgett / template.sh
Last active July 30, 2022 21:34
Bash Script Template
#! /bin/bash
COLOR_NC='\033[0m' # No Color
COLOR_LGREEN='\033[1;32m'
COLOR_GRAY='\033[1;30m'
COLOR_LGRAY='\033[0;37m'
COLOR_RED='\033[0;31m'
logv() {
[[ -z "$VERBOSE" ]] && return 0;
@gburgett
gburgett / changelog.sh
Last active January 5, 2022 15:59
generates a changelog from git history, grabbing PRs from github
#! /bin/bash
COLOR_NC='\033[0m' # No Color
COLOR_LIGHT_GREEN='\033[1;32m'
COLOR_GRAY='\033[1;30m'
COLOR_RED='\033[0;31m'
logv() {
[[ ! -z "$VERBOSE" ]] && >&2 echo -e "${COLOR_GRAY}$*${COLOR_NC}"
}
@gburgett
gburgett / .gitconfig
Created December 14, 2017 17:09
gitconfig
[user]
name = Gordon
email = gburgett@****
signingkey = ******
[core]
excludesfile = /Users/gburgett/.gitignore_global
editor = /usr/bin/vim
[difftool "sourcetree"]
cmd = /usr/local/bin/bcomp \"$LOCAL\" \"$REMOTE\"
path = -ro
@gburgett
gburgett / expand_tabs.sh
Created September 18, 2017 20:11
Expand tabs to spaces in all found files
#! /bin/bash
COLOR_NC='\033[0m' # No Color
COLOR_LIGHT_GREEN='\033[1;32m'
usage() {
echo "$0 <files glob>
expand tabs to spaces in given files, printing names of files that would change.
" && \
grep " .)\ #" $0; exit 0;
@gburgett
gburgett / gist:d0d6543ca8170fdaef09458f8b66e98d
Created May 27, 2017 11:08
git secrets config for nodejs project
[secrets]
patterns = .*(TOKEN|token|SECRET|secret|KEY|key|PASS|pass)\\S*\\s*=\\s*\\w+\\s*$
patterns = .*(TOKEN|token|SECRET|secret|KEY|key|PASS|pass)\\S*\\s*=\\s*[[:punct:]]\\S+[[:punct:]]\\s*
allowed = .+=\\*+(\\s.*)?$
allowed = .+=\\s*process\\.env\\.\\S+
allowed = .+=\\s*[[:punct:]]test_.+$
allowed = `.+=\\s*\\${.+$
@gburgett
gburgett / broadcast.go
Created April 27, 2015 21:40
A broadcast channel implementation in Go.
/*
Package broadcast implements a broadcasting channel. The broadcaster
creates or wraps a channel which when written to is replicated to all attached
receivers.
example:
ticker := time.NewTicker(1 * time.Millisecond)
b, ch := broadcast.NewBroadcaster()
go func() {
@gburgett
gburgett / ObservableExtensions.scala
Created July 29, 2013 18:55
Pimp My Library style extensions for converting between scala.concurrent.Future and rxjava's Observables
package com.SimplyTrackable.logviewer.utils
import scala.concurrent.Future
import rx.Observable
import rx.Observer
import scala.concurrent.Promise
import scala.collection.generic.CanBuildFrom
import scala.concurrent.ExecutionContext
object ObservableExtensions {
@gburgett
gburgett / jsmockito-1.0.4.js
Created December 1, 2012 21:36
JsMockito better QUnit integration
/* vi:ts=2 sw=2 expandtab
*
* JsMockito v1.0.4
* http://github.com/chrisleishman/jsmockito
*
* Mockito port to JavaScript
*
* Copyright (c) 2009 Chris Leishman
* Licensed under the BSD license
*/
@gburgett
gburgett / Linq.groovy
Created January 28, 2012 21:07
jpropel linq and groovy
package propel.groovy.utils
import lombok.Functions;
/**
* This groovy class is an example of how to interface between the groovy 'closure' concept
* and Lombok's Functions. It provides a groovy way to call into JPropel's LINQ functions.
* Right now this is just a proof of concept, as I use more of the LINQ functions I'll add
* them to this gist.
* @author gordon burgett
*/
@gburgett
gburgett / qunit-testtimer-tests.html
Created January 12, 2012 06:51
QUnit asyncTest timer plugin
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7 ]> <html lang="en" class="ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" ><!--<![endif]-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">