Skip to content

Instantly share code, notes, and snippets.

View stsquad's full-sized avatar

Alex Bennée stsquad

View GitHub Profile
@stsquad
stsquad / yasnippet-modeline.el
Last active December 11, 2015 21:39
An attempt to return a mode-line format string that describes what keys will still be valid yasnippet abbreviations.
;;; yasnippet-modeline.el --- Update mode-line with potential YASnippet keywords
;; Copyright (C) 2013 Alex Bennée
;; Author: Alex Bennée <alex@bennee.com>
;; Maintainer: Alex Bennée <alex@bennee.com>
;; Version: 0.01
;; Homepage: https://gist.github.com/4664006
;; This file is not part of GNU Emacs.
@stsquad
stsquad / gist:5124431
Created March 9, 2013 15:02
Current scratch version
(defvar mark-list-mode-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map tabulated-list-mode-map)
(define-key map (kbd "RET") 'mark-list-visit-buffer)
(define-key map "\C-m" 'mark-list-visit-buffer)
(define-key map (kbd "d") 'mark-list-delete-mark)
map)
"Local keymap for `mark-list-mode-mode' buffers.")
(defvar mark-list-current-mark-list nil
@stsquad
stsquad / gist:8316550
Created January 8, 2014 13:11
Add the ability to run checkpatch from magit
;;;
;; Run checkpatch.pl if we can
;;
(defvar magit-checkpatch-script nil
"Path to local checkpatch script, if it exists.")
(make-variable-buffer-local 'magit-checkpatch-script)
(put 'magit-checkpatch-script 'permanent-local t)
;; Match checkpatch.pl output
(add-to-list
(defvar my-overlays nil)
(let ((start (point-min)))
(save-excursion
(goto-char start)
(while (re-search-forward "aaaa" nil t)
(let ((overlay (make-overlay start (- (match-beginning 0) 1))))
(add-to-list 'my-overlays overlay))
(forward-line)
(setq start (point)))))

Solving the HKG18 puzzle with org-mode

$ ./configure --target-list=aarch64-linux-user --static
$ make

My other machine is virtual

QEMU Status Report

from __future__ import print_function
#
# This script needs to be run on startup
# qemu -kernel ${KERNEL} -s -S
# and then:
# gdb ${KERNEL}.vmlinux -x ${QEMU_SRC}/tests/guest-debug/test-ss.py
#
# This is a soak test for single-stepping which attempts to detect
# failed single-steps by single stepping a whole kernel.
@stsquad
stsquad / personal-cleanup-old-lkml.js
Created May 11, 2023 09:29
Google App Script to cleanup my old lkml emails while keeping threads I'm in
/*
* Based on the original from http://www.skipser.com/p/2/p/auto-delete-email-in-any-gmail-label-.html
*
* Tweaked to keep messages from mythreads
*/
// The name of the Gmail Label that is to be checked for purging?
var LABEL_TO_DELETE = "kernel/lkml";
// But not these labels
var LABEL_TO_KEEP = "mythreads";