Skip to content

Instantly share code, notes, and snippets.

@akapav
akapav / gist:9b9375bf9bab41e403a3eb0c8742d41d
Created March 16, 2021 07:37
Display line number on interactive goto-line
;; line numbers
(defun goto-line-x (orig-goto-line)
"Display line number on interactive goto-line."
(interactive)
(unwind-protect
(progn
(linum-mode 1)
(call-interactively orig-goto-line))
(linum-mode -1)))
@akapav
akapav / gist:e2c72ca64b4684777683bfc06a981d35
Created October 24, 2020 14:20
Kinesis Advantage2 setup
[pdown]>[kpshift]
[up]>[down]
[down]>[up]
[delete]>[escape]
[home]>[lshift]
[pup]>[rshift]
[rwin]>[ralt]
[end]>[lwin]
[kp-pdown]>[kpshift]
use std::collections::HashMap;
use std::iter::IntoIterator;
use std::str::FromStr;
use std::usize;
use std::env;
use std::time::{Duration, Instant};
const TEST_SIZE: usize = 100_000_000;
fn hash_test(n: usize) -> HashMap<usize, usize> {
### Keybase proof
I hereby claim:
* I am akapav on github.
* I am akapav (https://keybase.io/akapav) on keybase.
* I have a public key whose fingerprint is 3C93 37D5 F44A 95D8 B54F 9B3F CEEC E23C D694 2A7F
To claim this, I am signing this object:
_____ _ |_ _|| | | | | |__ | | | '_ \ | | | | | | |_| |_| |_|
@akapav
akapav / riddle.lua
Created July 4, 2017 21:57
Puzzle 1
-- http://www.bbc.co.uk/programmes/articles/5wkxjTtqRvq8Cyrrjxtk7tc/puzzle-for-today
local function str_comb(comb)
local str = "1"
local next = 2
for i = 1, 8 do
local op = comb[i]
if (op == 0) then str = str .. "+"
elseif (op == 1) then str = str .. "-"
end
str = str .. tostring(next)