Skip to content

Instantly share code, notes, and snippets.

View evertedsphere's full-sized avatar
🖥️

Soham Chowdhury evertedsphere

🖥️
View GitHub Profile
@evertedsphere
evertedsphere / winnav.sh
Last active June 30, 2023 20:05
i3/tmux unified navigation
#!/usr/bin/env bash
nav() {
win_name="$(xdotool getactivewindow getwindowname)"
if [[ "$win_name" =~ ^tmux: ]]; then
target="$(echo "$win_name" | sed -E 's/^tmux:(.+)/\1:/')"
pane_at_edge="$(tmux display -t "$target" -p "#{pane_at_$3}")"
if [[ "$pane_at_edge" =~ "0" ]]; then
tmux select-pane -t "$target" "-$1"
return
/* Compact tab layout */
:root { --tab-height: 40px !important; }
.tab { height: 40px !important; margin: 0; padding: 0; }
/* Shrink space between pinned tabs and tab bar, only when pins are present */
#tabbar[style*="margin"] { margin-top: 20px !important; }
/* Show title of unread tabs with red font */
.tab.unread .label {
color: red !important;
}
@evertedsphere
evertedsphere / MapAccumLM.hs
Last active December 1, 2021 16:50
monadic mapAccumL adventures
-- a tiny tutorial.
{-# LANGUAGE TypeApplications, ScopedTypeVariables #-}
module Main where
-- read until the end for something that may be a surprise
-- (if you're newer to haskell)
import Control.Monad.State
import Control.Category ((>>>))
@evertedsphere
evertedsphere / keybase.md
Created July 26, 2021 08:12
keybase verification

Keybase proof

I hereby claim:

  • I am evertedsphere on github.
  • I am evertedsphere (https://keybase.io/evertedsphere) on keybase.
  • I have a public key ASDGWVt7w9p0qq-wKdAeIfrMe-TKuu4DvgpzI4s_MYY69Qo

To claim this, I am signing this object:

@evertedsphere
evertedsphere / remap.py
Created May 21, 2020 15:52
evdev-based remap
#!/usr/bin/python3
# Original:
# https://gist.github.com/t184256/f4994037a2a204774ef3b9a2b38736dc
# I used this as a starting point.
# This is an example Python program for Linux that remaps a keyboard.
# The events (key presses releases and repeats), are captured with evdev,
# and then injected back with uinput.
@evertedsphere
evertedsphere / rts.ll
Created May 5, 2020 01:54
llvm idris rts
; TODO load int32 etc by value instead of jumping through a pointer
; like we currently do for consistency
target triple = "x86_64-unknown-linux-gnu"
%Arglist = type { i32, i32, %Value* } ; pointer to a list of values
%Func = type void (%Value*, %Arglist*)*
%Value = type { i8, [24 x i8] }
@evertedsphere
evertedsphere / ttt.rkt
Created April 18, 2020 04:39
TextTT s-expression language
(fn
#:name Main_main
#:args []
#:body (app #:fn PrimIO_putStrLn #:args [(constant #:type 'string #:val "hello world")]))
(fn
#:name Prelude_case__3176_3342
#:args [arg_0 arg_1]
#:body
(con-case
@evertedsphere
evertedsphere / ttt.lisp
Created April 17, 2020 16:20
TextTT s-expression format example
(^fn
:name prim__add_Int
:args [arg_0 arg_1]
:body (^prim-app :op +Int :args [arg_0 arg_1]))
(^fn
:name prim__add_Integer
:args [arg_0 arg_1]
:body (^prim-app :op +Integer :args [arg_0 arg_1]))