Skip to content

Instantly share code, notes, and snippets.

@zcmarine
zcmarine / fibonacci_lists.py
Last active March 30, 2018 06:00
Given a fibonacci number, create all lists of fibonacci numbers that sum to the given fibonacci number.
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 March 28, 2017 15:35
Hammerspoon capslock remapping: tap to Escape, hold in chord for Control
-- 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