Skip to content

Instantly share code, notes, and snippets.

@memchr
memchr / import_env
Created August 28, 2023 18:43
import_env
#!/usr/bin/env bash
set -e
[[ -n $HYPRLAND_DEBUG_CONF ]] && exit 0
USAGE="\
Import environment variables
Usgae: $0 <command>
Commands:
@kepano
kepano / obsidian-web-clipper.js
Last active May 5, 2024 23:29
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@johnrichardrinehart
johnrichardrinehart / nixos_in_virtualbox.md
Last active May 5, 2024 19:05
NixOS from "scratch" as Virtualbox Guest

Steps

New VirtualBox Machine

  1. Create a new disk image (I use VDI for compatibility with VirtualBox)
  2. Allocate some RAM (>6 GiB to start)
  3. Add some video memory and enable 3D acceleration, if needed
  4. Optional: Enable EFI (instead of BIOS)
  5. Attach nixos-minimal ISO for installation
  6. Boot into the ISO

Inside the Live CD

UEFI instructions

@quangIO
quangIO / wezterm.lua
Created March 15, 2022 15:08
My wezterm config with tmux-like bindings
local wezterm = require 'wezterm';
return {
color_scheme = "Dracula",
-- colors = {
-- background = "#0c0e14",
-- },
window_decorations = "NONE",
font = wezterm.font("Iosevka"),
font_size = 10.0,
-- dpi = 192.0,
@sdondley
sdondley / tmux split-window subcommand.md
Last active May 2, 2024 10:28
Super Guide to the split-window tmux Subcommand (and Beyond)

Super Guide to the split-window tmux Subcommand (and Beyond)

Guide overview

tmux, like other great software, is deceptive. On the one hand, it's fairly easy to get set up and start using right away. On the other hand, it's difficult to take advantage of tmux's adanced power features without spending some quality alone time with the manual. But the problem with manuals is that they aren't geared toward beginners. They are geared toward helping seasoned developers and computer enthusiasts quickly obtain the

@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@ryo-ARAKI
ryo-ARAKI / starship.toml
Last active April 28, 2024 23:14
Starship configuration file
# ~/.config/starship.toml
[battery]
full_symbol = "🔋"
charging_symbol = "🔌"
discharging_symbol = "⚡"
[[battery.display]]
threshold = 30
style = "bold red"

yt-dlp termux full installation guide.md

Prepare

  1. Install Termux from Github: https://github.com/termux/termux-app/releases
  2. Download the apk and install it -> Note that installing termux from Play Store is highly discouraged.

In Termux:

pkg update
@jcberthon
jcberthon / networkmanager-wifi-powersave.md
Last active April 22, 2024 14:33
NetworkManager Wi-Fi powersaving configuration

NetworkManager WiFi Power Saving

NetworkManager supports WiFi powersaving but the function is rather undocumented.

From the source code: wifi.powersave can have the following value:

  • NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
  • NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting
  • NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
# Luke's config for the Zoomer Shell
# Enable colors and change prompt:
autoload -U colors && colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.cache/zsh/history