Skip to content

Instantly share code, notes, and snippets.

View gagbo's full-sized avatar

Gerry Agbobada gagbo

View GitHub Profile
@gagbo
gagbo / ergodox.bepo.json
Last active December 28, 2021 11:05
SteveP layout configuration for bépo (https://stevep99.github.io/keyboard-layout-analyzer)
{
"label": "BÉPO Dox",
"fingerStart": {
"1": 29,
"2": 30,
"3": 31,
"4": 32,
"5": 66,
"6": 75,
"7": 35,
@gagbo
gagbo / ligature-bug-light.el
Created April 26, 2020 00:09
Ligther version of composite.c bug in emacs 27
;;; ligature-bug-light.el --- Reproduce an autocomposition bug -*- lexical-binding: t; -*-
;;; Commentary:
;;
;; Reproducer for the composition table bug
;;
;;;; Method
;;
;; Evaluate the file
;; Expected : "=> testing overlays" is displayed at some point and disappear
;; Actual : inifinite looping, trying to "shape unibyte text",
@gagbo
gagbo / atom_rewards.py
Last active April 21, 2020 13:42
Compute estimation of reward rates for ATOM
#!/usr/bin/env python3
from typing import NewType
Atom = NewType("Atom", float)
Seconds = NewType("Seconds", float)
# Network parameters that affect the formula
# Target bonded ratio of ATOMs
TARGET_BONDED_RATIO = 0.67
@gagbo
gagbo / empty_string_issue.org
Created January 11, 2020 17:14
Bug with src/composite.c in emacs 27 ?

empty_string_issue

Issue

While trying to use elisp code to get ligatures working on a build of emacs-27 branch, I noticed that a few ligatures from the table was freezing emacs.

Recipe

Emacs version

I think you only need an emacs-27 build --with-harfbuzz

@gagbo
gagbo / which-key.c
Created September 28, 2019 23:10
Get keycodes in terminal
#include <stdio.h>
#include <curses.h>
#include <ncurses.h>
#include <locale.h>
#include <wchar.h>
int main()
{
setlocale(LC_CTYPE, ""); initscr(); raw(); noecho(); keypad(stdscr, TRUE);
wint_t c;
@gagbo
gagbo / colorstrans.el
Created July 31, 2019 20:46
Translate colors from true color to 256-color in emacs-lisp
;;; colortrans.el --- simple conversion tool between truecolor and xterm
;; -*- coding: utf-8; lexical-binding: t; -*-
;; Copyright © 2019, by Gerry Agbobada
;; Author: Gerry Agbobada ( gagbobada+git@gmail.com )
;; Version: 0.0.1
;; Created: 09 May 2019
;; Keywords: color
@gagbo
gagbo / colortrans.py
Created July 31, 2019 20:44
Translate truecolor to 256-color palette
#!/usr/bin/env python3
"""
Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
The legacy version uses naive euclidean distance in rgb space,
the non-legacy version uses naive euclidean distance in hsv space, manually
@gagbo
gagbo / AGB-001_Light_Mod.md
Created June 9, 2018 13:55 — forked from grantland/AGB-001_Light_Mod.md
AGB-001 Front/Backlight Mod Instructions

AGB-001 Front/Backlight Mod Instructions

AGB-001 Backlight Mod

Requirements

  • AGB-001
  • ASS101 screen
@gagbo
gagbo / swap_manage.vim
Created November 22, 2017 14:18
Properly manage swap files in vim
augroup SwapfileManagement " From a tpope snippet.
autocmd!
" The trick is that resetting 'swapfile' deletes the swapfile.
" The if is most likely for the cases when dir is nuked while editing
autocmd CursorHold,BufWritePost,BufReadPost,BufLeave *
\ if isdirectory(expand("<amatch>:h")) |
\ let &swapfile = &modified | endif
augroup END