Skip to content

Instantly share code, notes, and snippets.

Avatar

superfawkes

  • Singapore
View GitHub Profile
@superfawkes
superfawkes / gmailautocleanup.js
Last active Aug 7, 2019
Gmail Inbox maintenance - automatically cleans up older email notifications that have only a transient use - either by sender or by filter-folder
View gmailautocleanup.js
// 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
Utility script to download BBC's non-commercial sound effects library
View download_bbc_sound_effects.py
#!/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 Jun 30, 2017
Interactive Git Stash utility
View iStash.sh
#!/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 Jun 22, 2016
Git Diff to Svn Diff - compatible with Crucible andCode Review software
View git-svn-diff.sh
#!/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 Apr 23, 2014
Useful bash settings for the OS X Terminal
View .bashrc
# 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
You can’t perform that action at this time.