Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# add to autostart.conf: exec-once = ~/.config/hypr/scripts/better-padding.sh
# gapsout for when there's just one window
solo_padding=100
# gapsout for when 2+ windows
plural_padding=10
@jondkinney
jondkinney / README.md
Created August 22, 2025 14:06
asahi-linux-aarch64-m1-macbook-pro-backlight-control.md

Keyboard Backlight OSD for Hyprland with SwayOSD

Add beautiful on-screen display (OSD) popups for keyboard backlight control on Hyprland, matching the style of volume/brightness controls.

Features

  • Clean progress bar OSD matching system brightness/volume style
  • Consistent 10% increment steps (0%, 10%, 20%...100%)
  • Works with fn+F3/F4 keys on Apple Silicon (Asahi Linux)
  • Uses SwayOSD for unified look
@jondkinney
jondkinney / lazygit-statusline.lua
Last active August 7, 2025 01:41
LazyGit Statusline Override
--============================================================================--
--
-- Lazygit Editor Detection and Statusline Customization
--
--============================================================================--
--
-- This plugin detects when Neovim is launched from lazygit as an editor and
-- changes the statusline color to indicate this special editing mode. This helps
-- prevent confusion when editing files from within lazygit, as the editor
-- appears fullscreen and can be mistaken for a regular Neovim session.
@jondkinney
jondkinney / astrolsp_no_undo.lua
Created August 6, 2025 22:40
Undo History Refined
-- Disable undo history for LSP formatting/code actions
-- This prevents import organization and formatting from cluttering undo history
---@type LazySpec
return {
"AstroNvim/astrolsp",
opts = {
autocmds = {
format_on_save_preserve_undo = {
{
@jondkinney
jondkinney / keybindings.json
Created January 26, 2025 09:10
Vim-like VSCode Settings
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+l",
"command": "workbench.action.focusFirstEditorGroup",
"when": "sideBarFocus"
},
{
"key": "ctrl+h",
"command": "workbench.action.focusActiveEditorGroup",
@jondkinney
jondkinney / popen3_test
Created September 10, 2017 06:59 — forked from chrisn/popen3_test
Ruby example of using Open3.popen3 with a select loop to read a child process's standard output and standard error streams.
#!/usr/bin/env ruby
require 'open3'
# Returns true if all files are EOF
#
def all_eof(files)
files.find { |f| !f.eof }.nil?
end
#!/usr/bin/perl
# Script to (generate a script to) fix excess use of double-quotes in HAML.
# To use:
#
# haml-lint app/views/ > haml_errors
# grep "you don't need string interpolation" haml_errors | awk '{print $1}' > single_quote_me
# perl single_quote.pl
# bash fixme.sh
# git commit -a -m "Use single-quotes in straightforward cases"
@jondkinney
jondkinney / edgerouter-qos
Created April 16, 2016 22:14 — forked from beardicus/edgerouter-qos
EdgeRouter Lite QOS Settings
#
# fair-queue based settings for EdgeRouter Lite traffic shaping
#
# download is typically 30 and change. everything can burst to 100%
# of bandwidth, priority rules keep the garbage in check
set traffic-policy shaper download
set traffic-policy shaper download bandwidth 30Mbit
require 'erb'
# lib/missing_spec_generator.rb
class MissingSpecGenerator
RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
def spec_file spec_path, file_name, spec_template, namespace
spec_name = file_name.gsub('.rb', '') + '_spec.rb'
if File.exist?("#{spec_path}/#{spec_name}")
puts "#{spec_path}/#{spec_name} exists"

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh [email protected]

Add ssh fingerprint and enter password provided in email