Skip to content

Instantly share code, notes, and snippets.

View martinstoyanov's full-sized avatar

Martin Stoyanov martinstoyanov

View GitHub Profile
from random import randint
# generates combinations in k-tuples/triples etc. if k=2 (1,2).
# combinations('ABCD', 2) --> AB AC AD BC BD CD
# combinations(range(4), 3) --> 012 013 023 123
def combinations(iterable, r):
pool = tuple(iterable)
n = len(pool)
@martinstoyanov
martinstoyanov / README.md
Created November 10, 2020 12:03 — forked from ascendbruce/README.md
Use mac style shortcuts on Windows with AutoHotkey (ahk) script

Use (most) macOS style shortcuts on Windows

Make Windows PC's shortcut act like macOS (Mac OS X)

With this AutoHotKey script, you can use most macOS style shortcuts (eg, cmd+c, cmd+v, ...) on Windows with a standard PC keyboard.

Note that

  1. You should disable the Between input languages shotcut from Control Panel\Clock, Language, and Region\Language\Advanced settings > Change lanugage bar hot keys because it conflicts with cmd + shift + ↑ / ↓ / ← / → (select text between cursor and top / bottom / beginning of line / end of line)
  2. you shouldn't change the modifier keys mapping with keyboard DIP. This script assumes you use a standard PC keyboard layout, and wish to use shortcuts as if it was a mac keyboard layout.