Skip to content

Instantly share code, notes, and snippets.

@zcmarine
zcmarine / fibonacci_lists.py
Last active Mar 30, 2018
Given a fibonacci number, create all lists of fibonacci numbers that sum to the given fibonacci number.
View fibonacci_lists.py
import logging
logger = logging.getLogger(__name__)
def build_fibonacci_numbers(num):
""" Create the fibonacci numbers up to and including a given fibonacci number """
if num <= 0:
raise ValueError('num must be greater than 0')
@zcmarine
zcmarine / remap_capslock.lua
Created Mar 28, 2017
Hammerspoon capslock remapping: tap to Escape, hold in chord for Control
View remap_capslock.lua
-- Inspired by https://github.com/jasoncodes/dotfiles/blob/master/hammerspoon/control_escape.lua
-- You'll also have to install Karabiner Elements and map caps_lock to left_control there
len = function(t)
local length = 0
for k, v in pairs(t) do
length = length + 1
end
return length
end