Skip to content

Instantly share code, notes, and snippets.

View kevinawoo's full-sized avatar

Kevin Woo kevinawoo

View GitHub Profile
@kevinawoo
kevinawoo / ignore_moves.py
Last active September 1, 2015 22:14 — forked from RichardBronosky/ignore_moves.py
git diff ignore moved lines
#!/usr/bin/env python
"""
ignore_moves.py v0.2
Filter relocated lines from a unified diff format stream.
Offered under the terms of the MIT License at github.com
Taken from http://stackoverflow.com/questions/1380333/
"""
import sys
from optparse import OptionParser
/usr/local/bin/make-completion-wrapper:
#!/bin/sh
# Author.: Ole J
# Date...: 23.03.2008
# License: Whatever
# Wraps a completion function
# make-completion-wrapper <actual completion function> <name of new func.> <alias>
# <command name> <list supplied arguments>
# eg.
#!/bin/bash
# git functions
__git_branch_info() {
git for-each-ref --format="%(refname:short) %(upstream:short)" refs/heads | \
while read local remote
do
[ -z "$remote" ] && continue
git rev-list --left-right ${local}...${remote} -- 2>/dev/null >/tmp/git_upstream_status_delta || continue
LEFT_AHEAD=$(grep -c '^<' /tmp/git_upstream_status_delta)

Git Commit Messages

  • Messages answers the following sentence:

    Apply this commit to _______________

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
  • Limit the first line to 72 characters or less
  • Reference issues and pull requests liberally
  • When only changing documentation, include [ci skip] in the commit description
  • Consider starting the commit message with an applicable emoji:
@kevinawoo
kevinawoo / nodemon.json
Last active June 29, 2017 20:06
nodemon.js
{
"restartable": "rs",
"colours": true,
"execMap": {
"py": "python",
"rb": "ruby",
"sh": "bash"
},
"watch": [
"**/*"
#!/bin/bash
set -e
root=$PWD
# This loads NVM
[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh
[[ -s /usr/local/opt/nvm/nvm.sh ]] && . "/usr/local/opt/nvm/nvm.sh"
schema: "1"
id: myFirstBareBones
protect: true
metadata:
name: Bare Bone Pippeline Template
description: A generic application bake & tag pipeline.
owner: [email protected]
scopes: [global]
variables:
@kevinawoo
kevinawoo / block_personal_appts
Created February 6, 2018 22:38 — forked from ttrahan/block_personal_appts
Google Apps Script to automatically create, edit and delete events on work calendar for personal calendar events. Instructions on how to set up can be found at https://medium.com/@willroman/auto-block-time-on-your-work-google-calendar-for-your-personal-events-2a752ae91dab
function sync() {
var id="XXXXXXXXXX"; // CHANGE - id of the secondary calendar to pull events from
var today=new Date();
var enddate=new Date();
enddate.setDate(today.getDate()+7); // how many days in advance to monitor and block off time
var secondaryCal=CalendarApp.getCalendarById(id);
var secondaryEvents=secondaryCal.getEvents(today,enddate);
@kevinawoo
kevinawoo / webinar-script.sh
Created October 31, 2019 16:17
Using the Operator to deploy Spinnaker
# Create a directory for the Spinnaker Operator YML files downloaded from https://github.com/armory-io/spinnaker-operator/releases/download/v0.1.0/manifests.tgz
mkdir spinnaker-operator
cd spinnaker-operator
VERSION=v0.2.0 && curl -L https://github.com/armory-io/spinnaker-operator/releases/download/$VERSION/manifests.tgz | tar -xvf -
# Apply the Spinnaker Operator Custom Resource (CRD)
# A Kubernetes custom resource is an extension of the Kubernetes API which represents a customization of a particular Kubernetes installation.
@kevinawoo
kevinawoo / stability.yaml
Last active February 14, 2020 19:46
stability.yaml
# At a minimum, all we care about is when it's stable/succesful so we know if a stage should continue
# if one of stable.* is TRUE, then it's stable!
stability.spinnaker.io/stable/handler: Field
stability.spinnaker.io/stable/field: ".status.status=successful"
stability.spinnaker.io/stable.1/handler: Field
stability.spinnaker.io/stable.1/field: ".status.status=ok"
stability.spinnaker.io/stable.2/handler: Field
stability.spinnaker.io/stable.2/field: ".status.status=yay"
# another way of handling it maybe to just do comma separated conditions (same for failed status)