Skip to content

Instantly share code, notes, and snippets.

@wolever
wolever / fix-mouse.lua
Created Nov 7, 2019
Hammerspoon config to use mouse button 3 for scrolling, remap button 4 to middle button
View fix-mouse.lua
-- HANDLE SCROLLING WITH MOUSE BUTTON PRESSED
local scrollMouseButton = 3
local deferred = false
overrideOtherMouseDown = hs.eventtap.new({ hs.eventtap.event.types.otherMouseDown }, function(e)
-- print(hs.eventtap.event.properties['mouseEventButtonNumber'])
local mouseButton = e:getProperty(hs.eventtap.event.properties['mouseEventButtonNumber'])
if mouseButton == scrollMouseButton then
deferred = true
return true
@irvingpop
irvingpop / dna.json.tpl
Last active Sep 7, 2020
chef-solo like solution for Terraform
View dna.json.tpl
{
"mycookbook": {
"attribute1": "${attribute1}",
"attribute2": "${attribute2}"
},
"run_list": [
"recipe[${recipe}]"
]
}
View gist:3330485d5db38848fa32
import itertools
import boto
import pymongo
db = pymongo.Connection()['mci']
ec2 = boto.connect_ec2()
chain = itertools.chain.from_iterable
all_instances = list(chain([res.instances for res in ec2.get_all_instances()]))
all_instance_ids = set(instance.id for instance in all_instances)
@ehershey
ehershey / bigredbuttonosx
Last active May 24, 2018
How to use the Dream Cheeky Big Red Button on a Mac in OS X
View bigredbuttonosx
# Alternative to homebrew - install Mono directly via http://download.mono-project.com/archive/3.12.1/macos-10-x86/MonoFramework-MDK-3.12.1.macos10.xamarin.x86.pkg
# Install homebrew -
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install mono
brew install mono
# Download windows executable
open https://www.dropbox.com/s/3xmsr8cw02dfkl3/DreamCheekyBTN.zip
# Unzip
unzip DreamCheekyBTN.zip
# Create script
@jbreams
jbreams / gist:f9f5d6a7aafd26072cd3
Created Sep 8, 2014
AWS SSH Key Init Script
View gist:f9f5d6a7aafd26072cd3
#!/bin/bash
#
# Init file for AWS Authorized Keyfile
#
# chkconfig: 2345 11 25
# description: AWS Authorized Keyfile
case $1 in
start)
touch /var/lock/subsys/awssshkey
View bulkUnwatch.sh
#
# Bulk Unwatch
# JIRA doesn't support unwatch from the bulk change action
# This script fills the gap
# Known to work with JIRA 5 via the REST API
#
# 1. Using JIRA, Issue Navigator, write a query to get all
# the issues you want to unwatch. Something like
# "issue in watchedIssues() AND status != Closed"
# works well as a starting point.
@nakajima
nakajima / pivotaltracker.com.js
Created Jul 27, 2011
dotjs script to add j/k keyboard shortcuts to pivotal tracker
View pivotaltracker.com.js
/******************************************************************************
.js/pivotaltracker.com.js
Get dotjs here: http://defunkt.io/dotjs
Extracted from my dotjs files: https://github.com/nakajima/nakajima-dot-js
******************************************************************************/