Skip to content

Instantly share code, notes, and snippets.

View mroavi's full-sized avatar

Martin Roa Villescas mroavi

  • Eindhoven University of Technology
View GitHub Profile
@pfitzseb
pfitzseb / tmuxedit.jl
Last active February 22, 2021 15:38
edit in existing tmux pane that runs `vim`
# put this in your startup.jl
using InteractiveUtils
let
tmuxsession = nothing
sessions = split(String(read(`tmux list-panes -a -F '#{pane_tty} #{session_name}'`)), '\n')
io = IOBuffer()
run(pipeline(`tty`, stdout=io))
tty = chomp(String(take!(io)))
for session in sessions
if occursin(tty, session)
using ColorSchemes
using Javis
N = 6 # Number of dots
radius = 20 # Radius of each dot
colors = ColorSchemes.rainbow1 # Color palette
speed = 10 # Degrees per frame
function draw_circle(frame, i, radius, speed)
# Angle of the direction vector for the dot
@romainl
romainl / gq.vim
Last active August 21, 2022 17:17
Formatting without moving
" gq wrapper that:
" - tries its best at keeping the cursor in place
" - tries to handle formatter errors
function! Format(type, ...)
normal! '[v']gq
if v:shell_error > 0
silent undo
redraw
echomsg 'formatprg "' . &formatprg . '" exited with status ' . v:shell_error
endif
@paulo-raca
paulo-raca / unicode_input.py
Last active February 18, 2023 22:56
Using UInput to enter unicode text
from evdev import UInput, ecodes as e
import time
# This class sends CTRL+SHIFT+U+<HEXCODE> sequences to produces arbitrary unicode characters.
# It works fine on Gnome applications, but not on KDE
# in https://en.wikipedia.org/wiki/Unicode_input#In_X11_.28Linux_and_other_Unix_variants.29
class UnicodeInput:
def __init__(self):
keys = [
e.KEY_LEFTCTRL,
@huytd
huytd / todo.vim
Created June 14, 2020 07:34
A Todo list syntax in Vim, with an actual checkbox
" Vim syntax file
" Language: Todo
" Maintainer: Huy Tran
" Latest Revision: 14 June 2020
if exists("b:current_syntax")
finish
endif
" Custom conceal
@dataPulverizer
dataPulverizer / RegularExpressionsInJulia.jl
Created February 17, 2018 02:53
Regular Expressions In Julia
#=
Notes on Regular expressions in Julia:
Sources:
Regular Expressions Cookbook, Jan Goyvaerts & Steven Levithan.
https://www.regular-expressions.info/wordboundaries.html
https://www.regular-expressions.info/lookaround.html
http://www.rexegg.com/regex-disambiguation.html
Julialang Gitter Chat.
=#
@t184256
t184256 / example_remap.py
Created January 19, 2018 03:26
A thoroughly annotated example on keyboard remapping with evdev/uinput.
#!/usr/bin/python3
# CC0, originally written by t184256.
# 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.
# This approach should work in X, Wayland, anywhere!
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mishurov
mishurov / qt.mak
Last active April 9, 2024 21:06
Makefile to build QT projects (Linux) without qmake
CC=g++
MOC=moc-qt4
CFLAGS=-Wall
SOURCES=hello.cc hello_cls.cc
MOC_HEADERS=hello_cls.h
EXECUTABLE=hello
INCDIRS=-I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtCore
LIBS=-lQtCore -lQtGui
# Change postfixes
MOC_SOURCES=$(MOC_HEADERS:.h=.moc.cc)
@bittner
bittner / keyboard-keys.md
Created February 28, 2019 22:50
Keyboard keys markup in MarkDown

Ctrl + Alt + Space