Skip to content

Instantly share code, notes, and snippets.

View ayghri's full-sized avatar

Ayoub Ghriss ayghri

View GitHub Profile
@ayghri
ayghri / path.lua
Last active August 7, 2023 12:55
Path reduction algorithms for IDE
local M = {}
-- Map intergers 1... to A....
local function int_to_char(i) return string.char(i + 64) end
local function group_by_first(b_to_s)
local starts = {}
for b, s in pairs(b_to_s) do
if #s == 0 then
error("empty string in hash_by_first" .. vim.inspect(b_to_s))
end
@ayghri
ayghri / ltex.lua
Last active July 20, 2023 15:52 — forked from lbiaggi/ltex.lua
lspconfig - Implement addToDictionary for ltex
local S = {}
-- define the files for each language
-- new words will be added to the last file in the language table
S.dictionaries = {
["en-US"] = { vim.fn.stdpath("config") .. "/spell/en.txt" },
}
-- function to avoid interacting with the table directly
function S.getDictFiles(lang)
// ==UserScript==
// @name animelon-subtitle-downloader
// @namespace http://tampermonkey.net/
// @version 0.1
// @description download animelon subtitles
// @author mescyn#5794
// @match https://animelon.com/video/*
// @grant unsafeWindow
// @grant GM_registerMenuCommand
// @require https://cdn.jsdelivr.net/npm/[email protected]/dist/FileSaver.min.js
@Qteb
Qteb / printer.cfg
Last active March 7, 2025 03:57
Klipper configuration for SKR 1.4 PRO + 4x TMC2209 UART
# Specs:
# - SKR 1.4 PRO
# - TMC2209 UART
# - 1.8 stepper on XYZ
# - Physical endstops on XYZ
# - Fysetc Mini 12864 LCD Display v2.1 RGB
#
# Link to current version of this config: https://gist.github.com/Qteb/64baab2e57d65697633cc884dc783beb
# Klipper config reference: https://www.klipper3d.org/Config_Reference.html
# Gcode templates syntax: https://jinja.palletsprojects.com/en/2.10.x/templates/
@brentjanderson
brentjanderson / Howto.md
Created February 20, 2018 17:55
SSH Tunneling with Firefox

Sometimes it is useful to route traffic through a different machine for testing or development. At work, we have a VPN to a remote facility that we haven't bothered to fix for routing, so the only way to access a certain machine over that VPN is via an SSH tunnel to a machine that is reachable over the VPN. Other times, I have used this technique to test internet-facing requests against sites I am developing. It is pretty easy, and if you don't use firefox regularly, you can treat Firefox as your "Proxy" browser and other browsers can use a normal configuration (Although you can also configure an entire system to use the proxy, other articles exists that discuss this potential).

  1. Open a terminal
@zchee
zchee / actionlist.vim
Last active May 28, 2025 05:46
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>