Skip to content

Instantly share code, notes, and snippets.

View al3xandru's full-sized avatar

Alex Popescu al3xandru

View GitHub Profile
@al3xandru
al3xandru / 000_WDR_template_COPY_ME.md
Created June 29, 2022 18:41 — forked from tastapod/000_WDR_template_COPY_ME.md
Writing Decision Record (WDR) template we are using for coauthoring the Software Faster book

000 - Title that says what decision we made

  • Deciders: Daniel and Helen
  • Date: 2022-mm-dd
  • Obsoletes: WDR-nnn

Description

Prose description of the decision and its context. What did we decide? What caused us to make the decision? What else was going on at the time?

@al3xandru
al3xandru / moveWndNextSpace.lua
Last active February 17, 2019 01:57
Hammerspoon function for moving window to next desktop
-- Move window to adjacent Desktop
-- direction param can be 'left' or 'right'
function moveWndNextSpace(direction)
local win = hs.window.focusedWindow() or hs.window.frontmostWindow()
if not win then
return
end
if not win:isStandard() then
return
end
@al3xandru
al3xandru / latency.txt
Created October 15, 2018 01:20 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@al3xandru
al3xandru / tmux-cheatsheet.markdown
Created March 25, 2018 07:15 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@al3xandru
al3xandru / .tmux.conf
Created October 1, 2017 01:26
.tmux.conf reattach-to-user-namespace
# macOS clipboard
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
if-shell 'test "$(uname -s)" = Darwin' 'set-option -g default-command "exec reattach-to-user-namespace -l bash"'
@al3xandru
al3xandru / error.lua
Created August 23, 2017 05:32
Using screen function in hs.layout results in "Unable to find display: function: 0x60800084a3b0"
layout = {
{"Mail", nil, function() attemptSecondaryScreen() end, hs.geometry.unitrect(0, 0, 1, 0.7), nil, nil},
{"Slack", nil, attemptSecondaryScreen, hs.geometry.unitrect(0, 0.3, 1, 0.7), nil, nil}
}
function attemptSecondaryScreen()
local screens = hs.screen.allScreens()
if #screens > 1 then
for _, scr in ipairs(screens) do
if scr ~= hs.screen.primaryScreen() then
@al3xandru
al3xandru / java-dse-graph.xml
Created November 11, 2016 21:02
Maven snippet
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>java-dse-graph</artifactId>
<version>1.0.0-beta1</version>
</dependency>
@al3xandru
al3xandru / nmap.vim
Created November 4, 2016 08:21
Paste clipboard text as Markdown blockquote
nmap <localleader>bq pmaV`gw`a:s/^/> /g<CR>:nohlsearch<CR>o

KC60 Keyboard end-user tips, tricks, programming notes, etc.

Leimi's note: removed lots of stuff from the original gist of scottjl, (thanks to him by the way!), as in the end some wasn't useful for me. If you are intestered, go check the gist revisions.

The KC60 is kinda like a premade GH60 that was first sold on Massdrop during summer 2015.
It runs on TMK firmware, or something based on it at least (not sure this is the real source for the keyboard but it seems it is), which means it's heavily programmable.
There is a GUI tool (the source of this tool seems to be here) and a command-line tool to ease up the process of programming the board.
**Go check this great article on Key

@al3xandru
al3xandru / .vimrc
Created June 19, 2016 03:12
Trying to create new mappings for vim-orgmode promote header/subtree
augroup org
autocmd!
autocmd FileType org nmap <M-Left> <ah
autocmd FileType org nmap <M-S-Left> <ar
autocmd FileType org nmap <D-Left> <ah
autocmd FileType org nmap <D-S-Left> <ar
augroup END