Skip to content

Instantly share code, notes, and snippets.

View superfawkes's full-sized avatar

superfawkes

  • Singapore
View GitHub Profile
@superfawkes
superfawkes / gmailautocleanup.js
Last active March 30, 2022 12:32
Gmail Inbox maintenance - automatically cleans up older email notifications that have only a transient use - either by sender or by filter-folder
// adapted from idea in https://gist.github.com/anonymous/2cca33d376f7f924fdaa67891ad098cc
function EmailIdFromMailer(mailer)
{
var start = mailer.indexOf('<');
var end = mailer.indexOf('>');
if (start > -1 && end > -1)
{
return mailer.substring(start+1,end);
}
@superfawkes
superfawkes / download_bbc_sound_effects.py
Created May 2, 2018 10:14
Utility script to download BBC's non-commercial sound effects library
#!/usr/bin/env python
""" BBC Sound Effects scraper script: Copyright 2018 Shrinivas Ramani
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@superfawkes
superfawkes / iStash.sh
Created June 30, 2017 04:39
Interactive Git Stash utility
#!/bin/bash -f
function RecalcStashes {
PS3="`git stash list | wc -l` stashes present. Enter Option > "
}
function List {
if [[ $1 -eq 2 ]]; then
git stash list --pretty=format:"%C(red)%h%C(reset) - %C(green)(%cr) %C(bold blue)<%an>%C(reset) off %C(red)%p: %+s"
else
@superfawkes
superfawkes / git-svn-diff.sh
Created June 22, 2016 12:15
Git Diff to Svn Diff - compatible with Crucible andCode Review software
#!/bin/bash
#
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html)
# modified by mike@mikepearce.net
# modified by aconway@[redacted] - handle diffs that introduce new files
# modified by superfawkes - correct whitespaces in aconway's patch for Crucible, handle whitespaces for BSD/OSX styled sed
#
# Generate an SVN-compatible diff against the tip of the tracking branch
# Get the tracking branch (if we're on a branch)
@superfawkes
superfawkes / .bashrc
Created April 23, 2014 07:18
Useful bash settings for the OS X Terminal
# sets the terminal tab-name
function tabname {
printf "\e]1;$1\a"
}
# some git-stash-like goodies for svn
function shelf {
if [[ $# -lt 2 ]]; then
echo "Usage: $0 <patch-file-path> <files>"
return