Skip to content

Instantly share code, notes, and snippets.

@shimarin
shimarin / vtermtest.cpp
Last active April 6, 2024 13:00
SDL2 terminal emulator using libvterm
// g++ -o vtermtest vtermtest.cpp -lvterm -lutil -lSDL2 -lSDL2_ttf -licuuc
#include <termios.h>
#include <pty.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <iostream>
#include <vector>
#include <vterm.h>
#include <SDL2/SDL.h>
@abrochard
abrochard / presentation.org
Last active May 5, 2024 04:53
Notes from the "Conquering Kubernetes with Emacs" presentation

Conquering Kubernetes with Emacs

Specific Annoying workflow

Listing pods with kubectl get pods, then select a pod name and copy paste it into kubectl logs [pod name]

Why?

  • I want to streamline my workflow and stop using the terminal
  • learn more about kubernetes
  • main kubernetes extension for Emacs out there is greedy for permissions
@SilverSoldier
SilverSoldier / fonts.md
Last active January 26, 2023 21:03
xmessage useful options

In case fonts are not being displayed with an error message (Cannot convert string "" to type FontStruct)

Create a font using xfontsel or choose a font from xlsfonts

You don't even need the entire font description.

Ex. if you have the adobe font family just use

@romainl
romainl / Vim_pushing_built-in_features_beyond_their_limits.markdown
Last active September 19, 2023 08:16
Vim: pushing built-in features beyond their limits

Vim: pushing built-in features beyond their limits

The situation

Searching can be an efficient way to navigate the current buffer.

The first search commands we learn are usually / and ?. These are seriously cool, especially with the incsearch option enabled which lets us keep typing to refine our search pattern. / and ? really shine when all we want is to jump to something we already have our eyeballs on but they are not fit for every situation:

  • when we want to search something that's not directly there, those two commands can make us lose context very quickly,
  • when we need to compare the matches.
@jeetsukumaran
jeetsukumaran / DisableNonCountedBasicMotions.vim
Last active January 25, 2019 12:06
Disable Basic Motions if not Preceded By a Count
" Notes:
" (1) To enhance the ergonomics of this sufficiently to make it practical, at
" least, until your brain grows a new lobe dedicated to counting line offsets
" in the background while you work, you should either make sure you have
" something like the following in your `~/.vimrc`:
"
" set number
" if has('autocmd')
" augroup vimrc_linenumbering
" autocmd!
@pervognsen
pervognsen / wm.el
Last active October 22, 2023 02:10
Dynamic tiling window manager for Emacs (inspired by dwm/awesome/xmonad for Linux)
; This code is hereby released by its author (Per Vognsen) into the public domain.
; It's mostly a proof of concept though it was surprisingly usable for how simple it was to code.
; If you want to use it as a starting point for a more polished package, go right ahead.
(require 'cl)
(defstruct wm-window buffer (point 0) (start 0) (hscroll 0) dedicated)
(defvar wm-windows)
(defvar wm-windows-alist)
@hallettj
hallettj / 1. xmodmap .f90
Last active May 7, 2024 03:04
I inverted the number row on my keyboard - meaning that pressing the keys produces symbols by default, and I type numbers by holding shift. As a programmer I use symbols frequently, so I think that this will be advantageous. Here are the details of my configuration.
!
! Invert number row
!
! This changes the behavior of keys in the number row, but does not
! affect the number pad.
!
keycode 10 = exclam 1 1 exclam
keycode 11 = at 2 2 at
keycode 12 = numbersign 3 3 numbersign
keycode 13 = dollar 4 4 dollar
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@sjl
sjl / nextlast.vim
Created September 21, 2012 15:36
next/last text objects
" Next and Last {{{
" Motion for "next/last object". "Last" here means "previous", not "final".
" Unfortunately the "p" motion was already taken for paragraphs.
"
" Next acts on the next object of the given type in the current line, last acts
" on the previous object of the given type in the current line.
"
" Currently only works for (, [, {, b, r, B, ', and ".
"
@ryanoneill
ryanoneill / JettyLauncher.scala
Created April 9, 2012 03:49
JettyLauncher for Lift Framework for use with Heroku
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.{DefaultServlet, ServletContextHandler}
import org.eclipse.jetty.server.nio.SelectChannelConnector
import net.liftweb.http.LiftFilter
object JettyLauncher extends App {
// Slightly modified from
// https://github.com/ghostm/lift_blank_heroku
// to change Application to App
// Original version was modified based on the