Skip to content

Instantly share code, notes, and snippets.

@sprig
sprig / org-no-helm.el
Last active April 19, 2024 02:32
Advice for org-set-tags to disable helm completion
(defun kk/run-with-no-helm (orig-func &rest args)
"Run a function without helm completion."
(if (boundp 'helm-mode)
(let ((orig-helm-mode helm-mode))
(unwind-protect
(progn
(helm-mode 0)
(apply orig-func args)
)
(helm-mode (if orig-helm-mode 1 0))))
@sprig
sprig / Evernote_HTML_Downloader.js
Created January 11, 2016 21:57
Download entire page for selected notes, from the given URLs
var Evernote = Application("Evernote");
try
{
var newnotes = [];
var note, tags, tl, url, newNote, noteWindow;
var before = Evernote.tags.byName("foo");
var error = Evernote.tags.byName("bar");
var after = Evernote.tags.byName("baz");
@sprig
sprig / install-gentoo-zfs-root.txt
Created September 6, 2023 21:40 — forked from hww/install-gentoo-zfs-root.txt
Install gentoo ZFS root
#
# Boot Linux Live CD with ZFS support
# fearedbliss maintains a variant of System Rescue CD that is highly recommended:
# https://wiki.gentoo.org/wiki/User:Fearedbliss
# Instruction for a USB key version
# http://www.sysresccd.org/Sysresccd-manual-en_How_to_install_SystemRescueCd_on_an_USB-stick
# To use ssh
# ssh -fN -R localhost:10099:localhost:22 name@server
@sprig
sprig / setup-emacs-fonts.el
Created March 11, 2016 22:30
Config to set up nice fonts in emacs
(defun kk/setup-fonts (&rest args)
(interactive)
(set-face-font 'default "Source Code Pro for Powerline-11")
(set-fontset-font t 'hebrew (font-spec :name "Courier New-11"))
)
(advice-add 'server-create-window-system-frame :after 'kk/setup-fonts)
(advice-add 'server-create-tty-frame :after 'kk/setup-fonts)
(unless (daemonp) (kk/setup-fonts))
@sprig
sprig / .block
Created February 3, 2023 10:01 — forked from mbostock/.block
DOM-to-Canvas using D3
license: gpl-3.0
@sprig
sprig / README.md
Created September 23, 2022 17:20 — forked from nrocco/README.md
Alpine Playground with libvirt

First download alpine-make-vm-image from https://github.com/alpinelinux/alpine-make-vm-image

wget https://raw.githubusercontent.com/alpinelinux/alpine-make-vm-image/v0.4.0/alpine-make-vm-image \
    && echo '5fb3270e0d665e51b908e1755b40e9c9156917c0  alpine-make-vm-image' | sha1sum -c \
    || exit 1
mv alpine-make-vm-image /usr/local/bin/
chmod +x /usr/local/bin/alpine-make-vm-image

Create a new alpine qcow2 image

@sprig
sprig / fetch_kindle.js
Created March 8, 2021 16:06 — forked from yangchenyun/fetch_kindle.js
Get back my books from Kindle
/*
* @fileoverview Program to free the content in kindle books as plain HTML.
*
* This is largely based on reverse engineering kindle cloud app
* (https://read.amazon.com) to read book data from webSQL.
*
* Access to kindle library is required to download this book.
*/
// The Kindle Compression Module copied from http://read.amazon.com application
@sprig
sprig / 00-initialize-luarocks.sh
Last active December 8, 2020 19:38
Hammerspoon config
brew tap homebrew/versions
brew install lua53
## Don't remember now whether local works, possibly need to install via sudo
luarocks-5.3 install --local set
# sudo luarocks-5.3 install set
@sprig
sprig / HowToOTG.md
Created September 21, 2020 00:02 — forked from gbaman/HowToOTG.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@sprig
sprig / hypervisor.bat
Created January 21, 2020 18:46
Toggle Hyper-V Hypervisor startup for e.g. hyper-v/wsl2 vs vmware #windows
:: ON (Windows)
bcdedit /set hypervisorlaunchtype auto
:: OFF (vmware)