Skip to content

Instantly share code, notes, and snippets.

View sgdavis1's full-sized avatar

Steven Davis sgdavis1

View GitHub Profile
#!/bin/bash
destport=$(echo $1 | awk -F ':' '{print $2}');
desthost=$(echo $1 | awk -F ':' '{print $1}');
tunnelhost=$2
echo "Connecting to $1 via a tunnel through $2";
if [[ $destport == "" ]]; then
destport=22;
@sgdavis1
sgdavis1 / pre-commit
Created March 1, 2018 18:55
pre-commit hook for ensuring consistent naming in build.gradle
#!/bin/sh
version=$(grep "^version" build.gradle | awk -F "=" '{print $2}' | sed 's/[ \"]*//g')
branch=$(git branch |grep "*"|awk '{print $2}')
target_branch=$branch
skipversioncheck=$(git config --bool hooks.skipversioncheck)
if [[ $branch != "master" ]]; then
@sgdavis1
sgdavis1 / check_cordovalib.js
Created February 27, 2015 20:54
hooks/before_build/010_check_cordovalib.js
#!/usr/bin/env node
// This hook ensures no one has accidentally deleted the "cordova" script tag
var fs = require('fs');
var path = require('path');
var sys = require('sys')
var rootdir = process.argv[2];