Skip to content

Instantly share code, notes, and snippets.

View ivan-krukov's full-sized avatar
🗃️
Getting there

Ivan Krukov ivan-krukov

🗃️
Getting there
View GitHub Profile
@ivan-krukov
ivan-krukov / pad-rename.sh
Created March 20, 2018 16:43
Rename a bunch of files by zero padding
N=100
# create
for ((i = 1; i <= N; i++)); do
touch e-$i.csv
done
# rename
# note %04d - pad to 4 zeros
for ((i = 1; i <= N; i++)); do
import numpy as np
from collections import Counter, defaultdict
def __f(x, i, j):
'''Consume a state to generate a sequence of haplotypes picked'''
pairs = []
y = x.copy()
while True:
@ivan-krukov
ivan-krukov / modal-view.el
Last active March 6, 2023 12:11
Personal setup for modal navigation with view mode
;; add view mode keybindings
(use-package view
:config (setq view-read-only t) ;; C-x C-q can also toggle view-mode
:straight nil
:bind (("<f13>" . view-mode) ;; remap R-Shift to F 13
:map view-mode-map
("n" . forward-line)
("p" . previous-line)))
@ivan-krukov
ivan-krukov / emacs-animations.el
Created April 25, 2020 01:19
Emacs-mac animations
;; animations
;; Requires =emacs-mac= fork
;; repo: https://bitbucket.org/mituharu/emacs-mac
;; homebrew tap: https://github.com/railwaycat/homebrew-emacsmacport
;; Crazy example
(mac-start-animation nil :type 'page-curl-with-shadow
:duration 1.0 :direction 'right :angle 45)
;; Less crazy
(mac-start-animation (selected-window) :type 'move-out