Skip to content

Instantly share code, notes, and snippets.

View zzamboni's full-sized avatar
:octocat:

Diego Zamboni zzamboni

:octocat:
View GitHub Profile
@zzamboni
zzamboni / -
Last active July 15, 2017 21:44
elvish crash when pressing tab after the equals sign in an assignment
[~]─> a = <tab>
runtime error: invalid memory address or nil pointer dereference
goroutine 1 [running]:
github.com/elves/elvish/sys.DumpStack(0xc42045f018, 0x1)
/private/tmp/elvish-20170715-9639-kxuaux/src/github.com/elves/elvish/sys/dumpstack.go:7 +0x79
github.com/elves/elvish/shell.rescue()
/private/tmp/elvish-20170715-9639-kxuaux/src/github.com/elves/elvish/shell/shell.go:68 +0xd2
panic(0x45a41a0, 0x4892680)
/usr/local/Cellar/go/1.8.3/libexec/src/runtime/panic.go:489 +0x2cf
function doubleClick(e)
local pos=hs.mouse.getAbsolutePosition()
hs.eventtap.event.newMouseEvent(hs.eventtap.event.types.leftMouseDown, pos):setProperty(hs.eventtap.event.properties.mouseEventClickState, 2):post()
hs.eventtap.event.newMouseEvent(hs.eventtap.event.types.leftMouseUp, pos):post()
end
@zzamboni
zzamboni / catch_fn.lua
Last active August 24, 2023 10:21
How to catch the fn key using Hammerspoon
-- Catch fn-h and convert it to a left arrow key.
function catcher(event)
if event:getFlags()['fn'] and event:getCharacters() == "h" then
print("fn-h!")
return true, {hs.eventtap.event.newKeyEvent({}, "left", true)}
end
return false
end
local tapper=hs.eventtap.new({hs.eventtap.event.types.keyDown}, catcher):start()
@zzamboni
zzamboni / -
Created February 16, 2015 22:35
#! /bin/bash
### BEGIN INIT INFO
# Provides: riemann
# Required-Start: $all
# Required-Stop: $all
# Default-Start:
# Default-Stop: 0 1 6
# Short-Description: Starts Riemann
# chkconfig: - 80 15
# Description: Riemann event monitoring server.
@zzamboni
zzamboni / -
Created February 16, 2015 22:33
start() {
echo -n $"Starting ${NAME}: "
ulimit -n $NFILES
# daemon --pidfile $PID_FILE --user $RIEMANN_USER $DAEMON $DAEMON_OPTS
daemonize -u $RIEMANN_USER -p $PID_FILE -l $LOCK_FILE $DAEMON $DAEMON_OPTS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $LOCK_FILE
return $RETVAL
}
@zzamboni
zzamboni / Evernote - List tags that have a single note.scpt
Created January 14, 2015 06:05
Find all single-note tags in Evernote
(*
Evernote -- Find all single-note tags
January 13, 2015, Diego Zamboni
http://zzamboni.postach.io/find-all-single-note-tags-in-evernote
Based on:
http://veritrope.com
Evernote -- Empty Tag Remover
http://veritrope.com/code/evernote-empty-tag-remover
*)
@zzamboni
zzamboni / -
Created October 30, 2014 21:33
➜ ~/D/P/d/g/s/g/h/terraform git:(openstack-provider) ✗ git branch
master
* openstack-provider
➜ ~/D/P/d/g/s/g/h/terraform git:(openstack-provider) ✗ go get -u -v ./...
github.com/hashicorp/terraform (download)
github.com/hashicorp/go-checkpoint (download)
github.com/hashicorp/hcl (download)
github.com/mitchellh/copystructure (download)
github.com/mitchellh/reflectwalk (download)
github.com/mitchellh/mapstructure (download)
#first make sure go, git and mercurial are installed.
if [[ -z $(which git) ]]; then
echo "Git must be installed"
exit 1
fi
if [[ -z $(which hg) ]]; then
echo "mercurial must be installed"
exit 1
fi
@zzamboni
zzamboni / keybase.md
Created September 23, 2014 16:45
keybase.md

Keybase proof

I hereby claim:

  • I am zzamboni on github.
  • I am zzamboni (https://keybase.io/zzamboni) on keybase.
  • I have a public key whose fingerprint is 51EB CE05 779A 911D E67F F996 DAD7 2863 376A A4F6

To claim this, I am signing this object:

@zzamboni
zzamboni / test-sections.cf
Created November 25, 2013 23:56
Update/add <Directory> sections in an Apache config file.
body common control
{
bundlesequence => { "test" };
inputs => {
"lib/3.5/common.cf",
"lib/3.5/files.cf",
};
}
bundle agent test