Skip to content

Instantly share code, notes, and snippets.

View shadmansaleh's full-sized avatar
🚫
Might be slow to respond.

Shadman shadmansaleh

🚫
Might be slow to respond.
View GitHub Profile
{
"input": {
"blocklist": [],
"compressor#0": {
"attack": 5.0,
"boost-amount": 6.0,
"boost-threshold": -72.0,
"bypass": false,
"dry": -100.0,
"hpf-frequency": 10.0,
@kylechui
kylechui / dot-repeating.md
Last active June 26, 2024 06:02
A basic overview of how to manage dot-repeating in your Neovim plugin, as well as manipulate it to "force" what action is repeated.

Adding dot-repeat to your Neovim plugin

In Neovim, the . character repeats "the most recent action"; however, this is not always respected by plugin actions. Here we will explore how to build dot-repeat support directly into your plugin, bypassing the requirement of dependencies like repeat.vim.

The Basics

When some buffer-modifying action is performed, Neovim implicitly remembers the operator (e.g. d), motion (e.g. iw), and some other miscellaneous information. When the dot-repeat command is called, Neovim repeats that operator-motion combination. For example, if we type ci"text<Esc>, then we replace the inner contents of some double quotes with text, i.e. "hello world""text". Dot-repeating from here will do the same, i.e. "more samples""text".

Using operatorfunc

@JoveYu
JoveYu / lenovo-fn-q.sh
Last active June 4, 2024 08:50
Linux Lenovo Fn+Q Power Mode Script
#!/bin/bash
ACPI_BALANCE="\_SB.PCI0.LPC0.EC0.VPC0.DYTC 0x000FB001"
ACPI_POWER="\_SB.PCI0.LPC0.EC0.VPC0.DYTC 0x0012B001"
ACPI_ECO="\_SB.PCI0.LPC0.EC0.VPC0.DYTC 0x0013B001"
ACPI_MODE="\_SB.PCI0.LPC0.EC0.SPMO"
MODE=$(sudo sh -c "echo '$ACPI_MODE' > /proc/acpi/call; tr -d '\0' < /proc/acpi/call")
MODE=${MODE:2}
TARGET=$(((MODE+1)%3))
@smjonas
smjonas / json_pretty_print.lua
Created March 16, 2022 21:01
Utility function that turns a Lua table into a nicely formatted JSON string (pretty-printing).
--[[
MIT License
Copyright (c) 2022 Jonas Strittmatter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@folke
folke / lua-lsp.lua
Last active March 7, 2023 19:17
Correct sumneko lua lsp setup for init.lua and plugin development
-- put this file somewhere in your nvim config, like: ~/.config/nvim/lua/config/lua-lsp.lua
-- usage: require'lspconfig'.sumneko_lua.setup(require("config.lua-lsp"))
local library = {}
local path = vim.split(package.path, ";")
-- this is the ONLY correct way to setup your path
table.insert(path, "lua/?.lua")
table.insert(path, "lua/?/init.lua")
@svermeulen
svermeulen / MoonScriptLineNumberMap.moon
Created February 13, 2021 16:58
How I map moon script line numbers to lua
-- TODO - instead of calculating this every time we should cache the map to file
class MoonScriptLineNumberMap
new: =>
@_fileMapMap = {}
@_jobManager = LazyResolve('JobManager')
_createFileMap: (moonPath) =>
lines = @_jobManager\executeAndWaitGetAllOutputLines("moonc -X '#{moonPath}'")
fileMap = {}
first = true
@FreddieOliveira
FreddieOliveira / docker.md
Last active July 3, 2024 16:15
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@kcubeterm
kcubeterm / Google-sdk-termux.md
Last active June 30, 2024 04:10
How to install google cloud sdk in termux and run cloud shell interactively.

Now Google cloud sdk support python3.9 as well. Lets start.

Without any surprise,use your copy-paste skills to fire following script into your innocent terminal.

pkg install python3 openssh
curl -o sdk.sh sdk.cloud.google.com
chmod +x sdk.sh
./sdk.sh --install-dir=$PREFIX
@Meorawr
Meorawr / async.lua
Last active December 12, 2023 05:13
Lua 5.1 Async/Await
#!/usr/bin/lua5.1
--- Async/Await for Lua 5.1
-- This script implements async/await functions for Lua, allowing tasks to
-- be queued and scheduled independently.
--
-- This is just an example and has a bunch of issues, isn't tested, isn't
-- even actually used anywhere; I basically just got bored and had one of
-- those "what if?" type ideas 6 hours ago.
local co_create = coroutine.create
@laggardkernel
laggardkernel / startup-time-of-zsh.md
Last active June 21, 2024 15:27
Comparison of ZSH frameworks and plugin managers

Comparison of ZSH frameworks and plugin managers

Changelog

  • update 1: add a FAQ section
  • update 2: benchmark chart and feature comparison table
  • update 3:
    • improve the table with missing features for antigen
    • new zplg times result

TLDR