Skip to content

Instantly share code, notes, and snippets.

View leftclickben's full-sized avatar

Ben New leftclickben

View GitHub Profile
@leftclickben
leftclickben / git-update
Last active July 29, 2016 05:55
Pull down latest from git remote and remove dead branches
#!/bin/bash
#
# git-update
# Pull down latest from git remote and remove dead branches
#
# To create an alias to `git update`, put this on your path, then:
# git config --global alias.update '!git-update'
#
# Copyright (c) 2016 Leftclick.com.au
# License: MIT
@leftclickben
leftclickben / ubuntu-node-setup-5.x
Created January 22, 2016 16:42
Complete instructions for installing node 5.x on Ubuntu via apt (should work for other versions, just change `5.x`)
#!/bin/bash
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install nodejs
sudo chown -R $USER /usr/lib/node_modules/
sudo chgrp $USER /usr/bin
sudo chmod g+w /usr/bin
@leftclickben
leftclickben / experiment-gist-as-a-blogging-platform.md
Last active November 13, 2019 11:02
Experiment: gist as a blogging platform

Experiment: gist as a blogging platform

Am I crazy? Perhaps. But why shouldn't we use gist as a blogging platform?

What it has going for it

  • support for comments
  • renders markdown
  • support for multiple files, so code examples can be attached as well as inline
  • automatic indexing by search engines
@leftclickben
leftclickben / sloc-by-extension
Created October 12, 2020 06:31
Source analytics
#!/bin/bash
set -u
# usage example to find all Java source files: ./sloc-by-extension java
EXTENSION="${1}"
for dir in $(ls -d */); do
pushd ${dir} >/dev/null
LIST=$(find . -name "*.${EXTENSION}" | grep -iv test)