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 / -
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)
@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 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 / -
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 / 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()
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 / -
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
@zzamboni
zzamboni / -
Created September 20, 2017 06:08
these derivations will be built:
/nix/store/8a1n7h1k12h8amrwxr6p44shsiagpcr8-elvish-0.10.1.drv
building path(s) ‘/nix/store/39f41ffxfd0pkiba7q87vnms354vil71-elvish-0.10.1’, ‘/nix/store/jphygc1bq1f9yqmqk8h609fk5q4n75dh-elvish-0.10.1-bin’
unpacking sources
unpacking source archive /nix/store/va3v0qwd5s3r5diqs7vgs96bl72dw64b-elvish-0.10.1-src
source root is elvish-0.10.1-src
/nix/store/j1ly0zzpnzb8y8ry6k4vi4prk8vwq233-set-source-date-epoch-to-latest.sh: line 7: warning: command substitution: ignored null byte in input
patching sources
configuring
building
@zzamboni
zzamboni / -
Created October 16, 2017 20:58
--- CFEngine_Enterprise_vagrant_quickstart-3.10.2-1/Vagrantfile 2017-08-11 09:12:53.000000000 +0100
+++ CFEngine_Enterprise_vagrant_quickstart-3.10.2-1-fixed/Vagrantfile 2017-10-02 15:18:19.000000000 +0100
@@ -22,7 +22,7 @@
# bootstrap to the hub. Adjust this as desired.
if ENV['HOSTS']
- HOSTS=ENV['HOSTS']
+ hosts=ENV['HOSTS'].to_i
else
hosts=1
@zzamboni
zzamboni / -
Created October 17, 2017 12:56
installing ‘elvish-git’
these derivations will be built:
/nix/store/hfi4karap9v8c20igzy9vndy30k0bx0p-elvish-git.drv
building path(s) ‘/nix/store/bkyfpr1flv9cf3j9dr3q33bd7hyi7q76-elvish-git-bin’, ‘/nix/store/lq4g5pm7j9qrin9f9vsxf8fwijnyr4g8-elvish-git’
unpacking sources
unpacking source archive /nix/store/h373k33cgc3xvynkq5ajrc0b9l50y5cx-elvish
source root is elvish
patching sources
configuring
building