<prefix>-space
change layout
<prefix>-}
<prefix>-{
move pane
-;
move between panes
{ | |
"keyMappings": "# Insert your preferred key mappings here.\nmap e scrollPageUp", | |
"linkHintCharacters": "asdfqwerzxcv", | |
"regexFindMode": true, | |
"smoothScroll": false, | |
"settingsVersion": "2.1.2", | |
"exclusionRules": [ | |
{ | |
"passKeys": "", | |
"pattern": "https?://mail.google.com/*" |
function randomBoolean() { | |
return Math.random() < 0.5; | |
} | |
function chunkArray<T>(array: T[], chunkSize: number): T[][] { | |
return Array.from( | |
{ length: Math.ceil(array.length / chunkSize) }, | |
(_, index) => array.slice(index * chunkSize, (index + 1) * chunkSize), | |
); | |
} |
async function withMeasure<T>(label: string = 'Measurement', fn: () => Promise<T>) { | |
function bytes2MB(bytes: number): number { | |
return bytes / (1024 * 1024) | |
} | |
const pstart = performance.now() | |
const mstart = process.memoryUsage().heapUsed | |
const result = await fn() |
<prefix>-space
change layout
<prefix>-}
<prefix>-{
move pane
-;
move between panes
function Comp({ content }) { | |
return content.split('\r\n').map((line, i) => | |
<p key={i}>{line.length ? line : <br />}</p>) | |
} |
function useOutsideAlerter(ref, eventType, callback, childSelector) { | |
useEffect(() => { | |
function handler(event) { | |
if (!ref.current) return; | |
const clickedOutside = childSelector | |
? !Array.from(ref.current.querySelectorAll(childSelector)).some( | |
(node) => node.contains(event.target), | |
) | |
: !ref.current.contains(event.target); |
set -g default-terminal "screen-256color" | |
set-option -sa terminal-overrides ",xterm-256color:RGB" |
# https://www.reddit.com/r/NixOS/comments/mwbr8t/comment/gvhm2mh/?utm_source=share&utm_medium=web2x&context=3 | |
systemd.services.touchegg = { | |
enable = true; | |
description = "Touchégg. The daemon."; | |
wantedBy = [ "multi-user.target" ]; | |
serviceConfig = { | |
Type = "simple"; | |
Group = "input"; | |
Restart = "on-failure"; | |
RestartSec = 5; |
# nvim $profile - to edit the file | |
Import-Module PSFZF # enable fzf keybinding | |
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete # enable autocomplete |