Skip to content

Instantly share code, notes, and snippets.

@Djuuu
Djuuu / .xbindkeysrc
Created December 28, 2019 21:33
Logitech MX Master 3 - horizontal scroll as buttons - sensitivity reduction on Linux (xbindkeys & external script)
## Scrollwheel left
"~/.xbindkeys/MX-Master-3-bindings.sh Scroll_L"
b:7 + release
## Scrollwheel right
"~/.xbindkeys/MX-Master-3-bindings.sh Scroll_R"
b:6 + release
@hamidzr
hamidzr / sof-audio-setup-carbonx1.sh
Last active June 2, 2023 01:43
Lenovo Carbon X1 Gen 7 - Audio and microphone fix - https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_7) might be all you need.
#!/bin/bash
# README You probablyl don't need this script anymore. Please read the comments below to catch up.
## Description
# Lenovo Carbon X1 Gen 7 - Audio and microphone fix - kernel 5.3+ required.
# The script has only been tested for Arch and OpenSuse,
# Original thread: https://forums.lenovo.com/t5/Ubuntu/Guide-X1-Carbon-7th-Generation-Ubuntu-compatability/td-p/4489823
# Prereq: Install Linux 5.3 or newer
@jeremyblow
jeremyblow / dreem_csv_to_oscar_zeo.py
Last active February 28, 2024 02:56
Convert Dreem CSV to OSCAR-friendly Zeo CSV
"""Convert Dreem CSV to OSCAR-friendly Zeo CSV
Liberty taken with the ZQ column, pinning it to 0. Other non-common fields are nulled.
Tested with Python 3.7.3 and 2.7.10.
Usage:
python dreem_csv_to_oscar_zeo.py data_in.csv data_out.csv
"""
from csv import DictReader, DictWriter
from datetime import datetime, timedelta
@abrochard
abrochard / presentation.org
Last active March 7, 2025 21:53
Notes from the "Conquering Kubernetes with Emacs" presentation

Conquering Kubernetes with Emacs

Specific Annoying workflow

Listing pods with kubectl get pods, then select a pod name and copy paste it into kubectl logs [pod name]

Why?

  • I want to streamline my workflow and stop using the terminal
  • learn more about kubernetes
  • main kubernetes extension for Emacs out there is greedy for permissions
@chux0519
chux0519 / multi-level-sort.rs
Created February 5, 2019 13:21
multi level sort in rust
/// Multi-level sort a slice of Foobars according to [(field, reverse)]
fn sort_by_names(f: &mut [Foobar], orderings: &[(Foofields, bool)]) {
use std::cmp::Ordering;
f.sort_by(|a, b| {
let mut cmp = Ordering::Equal;
for (field, reverse) in orderings {
if cmp != Ordering::Equal {
break;
}
@mortymacs
mortymacs / increase-emacs-startup.md
Last active February 18, 2020 19:33
Increase emacs startup speed

Add this line in /etc/profile:

if [ ! `ps -x | grep emacs | grep daemon | awk '{ print $2 }'` ]; then
  emacs --daemon 2> /dev/null
fi

Relogin again to start the daemon.

Now you can edit your files with emacsclient command like so:

@bdarcus
bdarcus / setup.fish
Last active March 30, 2022 04:31
basic post-install setup script for fedora; run w/sudo
#!/usr/bin/env fish
# note: fish at first glance seems much more straightforward to setup with fisher than zsh with zinit
# In particular, fish works with XDG by default, while I wasted a lot of times on env variables
# to get it to work with zsh + zinnit correctly.
# fisher
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
# the theme options are many, but these two do async git update
@nvictus
nvictus / doi2bib
Last active February 27, 2023 23:48
Fetch reference citations in BibTeX, JSON or YAML from DOI
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
import tempfile
import requests
import argparse
import textwrap
import sys
@detrout
detrout / org-protocol.desktop
Created November 3, 2016 06:06
Desktop file to use org-protocol with xdg-open AKA GNOME 3 / KDE Plasma 5 (Save to ~/.local/share/applications/org-protocol.desktop
[Desktop Entry]
Version=1.0
Name=org-protocol helper
Comment=helper to allow GNOME to open org-protocol: pseudo-urls
TryExec=/usr/bin/emacsclient
Exec=/usr/bin/emacsclient %u
NoDisplay=true
Icon=emacs24
Terminal=false
Type=Application
@lonsun
lonsun / .fish
Created July 11, 2016 22:46
Fish shell script to remove local Git branches that have been merged and no longer appear on remote.
function git_clean_branches
set base_branch develop
# work from our base branch
git checkout $base_branch
# remove local tracking branches where the remote branch is gone
git fetch -p
# find all local branches that have been merged into the base branch