Skip to content

Instantly share code, notes, and snippets.

View mence's full-sized avatar
🔒
ETERNAL LOCKDOWN

Tim Hordern mence

🔒
ETERNAL LOCKDOWN
View GitHub Profile
@mence
mence / rsync-time-machine.py
Created April 6, 2017 23:04
My linux rsync time machine script
#!/usr/bin/python
"""
Karl's unix/rsync time-machine script.
Maintains daily and monthly snapshots of a directory tree, hard linked to save
space when files don't change.
Inspired by http://www.mikerubel.org/computers/rsync_snapshots/, but using
more robust coding practices.
Features:
@mence
mence / keybase.md
Created June 30, 2016 22:12
keybase.md

Keybase proof

I hereby claim:

  • I am mence on github.
  • I am timhordern (https://keybase.io/timhordern) on keybase.
  • I have a public key whose fingerprint is 85E2 FCE8 4DE1 7805 4611 AAED 69F4 99F8 6B82 4B65

To claim this, I am signing this object:

@mence
mence / todo.sh
Created June 29, 2016 15:57
todo-txt: todo.sh --> Add didit-cli-client shell call to do function
"do" )
errmsg="usage: $TODO_SH do ITEM#[, ITEM#, ITEM#, ...]"
# shift so we get arguments to the do request
shift;
[ "$#" -eq 0 ] && die "$errmsg"
# Split multiple do's, if comma separated change to whitespace separated
# Loop the 'do' function for each item
for item in ${*//,/ }; do
getTodo "$item"
@mence
mence / WindowsAutomationScripts.md
Last active June 22, 2016 21:20
Windows Automation Scripts
@mence
mence / index.coffee
Created July 31, 2015 17:53
Übersicht Widget - Italian Word of the Day
# Forked from https://github.com/felixhageloh/uebersicht-widgets/tree/master/german-word-of-the-day/german-word-of-the-day.widget by rizowski
command: 'curl -s "http://feeds.feedblitz.com/italian-word-of-the-day"'
refreshFrequency: 3600000
style: """
top: 500px
left: 0px
color: #fff
@mence
mence / gist:bc989877b29d588ab99c
Created July 10, 2015 22:24
How to exclude exact strings using a regular expression

Negative Lookaround

Does not match foo

^((?!foo).)*$

Result:

foo
bar <- match
@mence
mence / README.md
Created May 8, 2015 20:28
Making the RescueTime Chrome Extension correctly report website usage in Chromium

Making the RescueTime extension work in Chromium

By default, the RescueTime Chrome extension doesn't report exact site usage because the extension determines browser usage by parsing the User Agent string in the request. So we need to fool the extension into thinking that we're using Chrome, not Chromium, which means it will accurately report usage statistics to RescueTime.

  1. Determine the extension's ID by visiting chrome://extensions
  2. If you have not done so before, check Developer mode in the top right.
  3. Locate the id of the RescueTime extension. It will look something like this: ID: bdakmnplckeopfghnlpocafcepegjeap
  4. Navigate to the Chromium extensions location on your machine: ~/Library/Application Support/Chromium/Default/Extensions/{extension_id}/3.0.18_0
  5. Edit RescueTimeUtil.js to return the browser as being Chrome. See the example in RescueTimeUtil.js in this gist.