Skip to content

Instantly share code, notes, and snippets.

View alecthegeek's full-sized avatar
🤖
Dem keyboards don't go click click on their own you know

Alec Clews alecthegeek

🤖
Dem keyboards don't go click click on their own you know
View GitHub Profile
@alecthegeek
alecthegeek / dbshare.sh
Last active August 29, 2015 14:04
CLI script to copy a file to the user's public DropBox folder and put a shortened public link in the clipboard. Inspired by @matthewmccullough and @tlberglund
#! /usr/bin/env bash
# $1 file to share
db_home=$HOME/DropBox # You need to run the DropBox client on your workstation
db_id=<999999> #Put your Dropbox ID here
if [[ -f "$1" ]] ; then
cp "$1" $db_home/Public #Only works if you have an Old Style account with magic Public directory
@alecthegeek
alecthegeek / keybase.md
Created March 24, 2014 03:20
My Keybase Proof

Keybase proof

I hereby claim:

  • I am alecthegeek on github.
  • I am alecthegeek (https://keybase.io/alecthegeek) on keybase.
  • I have a public key whose fingerprint is BF8A E8CC 9DA3 C1E3 C5BD 0CDD 3FE7 B98F 9BBB FC7C

To claim this, I am signing this object:

@alecthegeek
alecthegeek / gist:7595870
Last active December 29, 2015 01:49 — forked from anonymous/gist:7595857
Running HomeBrew Rhino debugger on OS X
#!/bin/sh
# https://developer.mozilla.org/en/docs/Rhino/Debugger
java -cp $(brew --prefix)/Cellar/rhino/1.7R4/libexec/js.jar org.mozilla.javascript.tools.debugger.Main "$@"
@alecthegeek
alecthegeek / server-command
Created June 28, 2013 22:26
Start and Stop commands for PaperCut
#! /usr/bin/env bash
if [[ -x /Applications/PaperCut\ MF/server/bin/mac/server-command &&
-x /Applications/PaperCut\ NG/server/bin/mac/server-command ]] ; then
echo copies of both NG and MF installed!
exit 1
elif [[ -x /Applications/PaperCut\ MF/server/bin/mac/server-command ]]; then
app_root='/Applications/PaperCut MF'
elif [[ -x /Applications/PaperCut\ NG/server/bin/mac/server-command ]]; then
app_root='/Applications/PaperCut NG'
@alecthegeek
alecthegeek / gitWrapper
Last active December 17, 2015 09:39
Wraps the git init or git clone commands to double check the users's email address.
#!/usr/bin/env bash
# Wrapper script for git
if [[ -x /usr/local/bin/git ]] ; then
GIT=/usr/local/bin/git #Set for your environment"
elif [[ -x /usr/bin/git ]] ; then
GIT=/usr/bin/git #Set for your environment"
else
echo Git not installed correctly?
@alecthegeek
alecthegeek / makefile
Created January 3, 2013 06:32
Build an HTML file from POD
# Generate Perl POD (Plain Old Documentation)
#
.SUFFIXES:
.SUFFIXES: .html
@alecthegeek
alecthegeek / gist:4208339
Last active October 13, 2015 14:17
Mount and unmount smb file systems on OS X
#!/bin/sh
# Copyright (C) 2012-15 Alec Clews
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
@alecthegeek
alecthegeek / gist:4158419
Created November 28, 2012 01:22
Compare two directories when you have an old tool chain (no diff -q)
#!/bin/ksh
# Compare 2 directories for differences (e.g. current release and new release)
CURRENT=$1 ; shift
NEW=$1; shift
CURRENTDIFFFILE=/tmp/$(echo $CURRENT | sed -e 's/[/.][/.]*/_/g')
NEWDIFFFILE=/tmp/$(echo $NEW | sed -e 's/[/.][/.]*/_/g')
@alecthegeek
alecthegeek / svn.sh
Last active February 5, 2016 01:06
SVN Wrapper Script -- support for standard commit message templates and svn info output
#!/usr/bin/env bash
# A wrapper for SVN. Designed for
# GIt users who need access to command line SVN. Tries to adopt as much information from Git config
# Command Line SVN users who are working with people using TortoiseSVN on Windows
# People who have use build scripts that depend on the outfrom from svn info when they in a Git checkout
@alecthegeek
alecthegeek / fixgitprompt.sh
Created August 21, 2012 05:09
Fix for Git Prompt in Homebrew
# Upgraded git using Homebrew and now your __git_ps1() fails. Try something like this
# NB Still very fragile as had embedded version no
# enable git programmable completion features
if [ -f /usr/local/etc/bash_completion.d/git-completion.bash ]; then
. /usr/local/etc/bash_completion.d/git-completion.bash
fi
# enable git prompt