Skip to content

Instantly share code, notes, and snippets.

@fungiboletus
fungiboletus / hammerspoon-tim-time-tracking.lua
Last active May 3, 2023 14:37
Tim time tracker: Hammerspoon Lua script, to remind you to enable time tracking when you work
function isTimTimeTrackingLive()
local preferencesPath = os.getenv('HOME').."/Library/Containers/neat.software.Tim/Data/Library/Preferences/neat.software.Tim.plist"
local preferences = hs.plist.read(preferencesPath)
local data = hs.json.decode(preferences['Tim_Data'])
local tasks = data['tasks']
-- When Tim has a live session, a record has the same start and end timestamp
for key, task in pairs(tasks) do
records = task['records']
@jasonboukheir
jasonboukheir / git
Last active November 20, 2024 21:51
git when in unix, git.exe when in wsl
#!/bin/sh
if pwd | grep /mnt/c > /dev/null; then
exec git.exe "$@"
else
exec /usr/bin/git "$@"
fi
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 5, 2025 07:08
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

KEYBINDINGS
byobu keybindings can be user defined in /usr/share/byobu/keybindings/ (or within .screenrc if byobu-export was used). The common key bindings
are:
F2 - Create a new window
F3 - Move to previous window
F4 - Move to next window
@rodrigosetti
rodrigosetti / remove-unused-imports.py
Created February 7, 2013 21:49
Removes unused imports from a bunch of Java files.
#! /usr/bin/env python
# coding: utf-8
"""This script reads all .java files from a directory tree and removes unused
import statements. It may have errors in detecting import lines (e.g. import
lines within block comments, or import lines with another statement in the same
line), and it may have false-negatives when deciding to remove an import (i.e.
it only removes if the last import symbol word doesn't appear at all -
including comments - in the code).
@bhumphrey
bhumphrey / gist:3764983
Created September 22, 2012 03:10
Cherry-picking from another fork
git checkout <branch>
git fetch <other-fork-alias>
git cherry-pick <commit-hash>
git push <your-fork-alias>
@DGuidi
DGuidi / TileLayer.TileJSON.js
Created February 1, 2012 08:49
Leaflet TileCanvas
L.TileLayer.TileJSON = L.TileLayer.Canvas.extend({
options: {
debug: false
},
tileSize: 256,
initialize: function (options) {
L.Util.setOptions(this, options);