Skip to content

Instantly share code, notes, and snippets.

View rjray's full-sized avatar

Randy J. Ray rjray

  • http://www.nvidia.com
  • San Jose, CA
View GitHub Profile
@rjray
rjray / emacs-30.X+treesit-0.26.X.patch
Created February 13, 2026 01:39
Small patch to build emacs 30.X from source with the 0.26.X version of tree-sitter
--- src/treesit.c.orig 2026-02-12 17:30:03.991401040 -0800
+++ src/treesit.c 2026-02-12 16:52:54.203102378 -0800
@@ -34,7 +34,7 @@
# include "w32common.h"
/* In alphabetical order. */
-#undef ts_language_version
+#undef ts_language_abi_version
#undef ts_node_child
#undef ts_node_child_by_field_name
@rjray
rjray / heap.clj
Created February 17, 2018 05:06
Simple implementation of both min-heaps and max-heaps in one module.
;;; heap.clj
;;;
;;; An implementation of both min-heaps and max-heaps. Each heap is presented
;;; as a vector with the content stored from index 1. Index 0 is used to store
;;; a map that holds the functions to be used in comparing elements for the
;;; "bubble-up" and "heapify" operations.
(ns algorithms.heap)
;; Swap two elements of the given vector, using assoc! on the assumption that
;; the vector is currently transient.

Keybase proof

I hereby claim:

  • I am rjray on github.
  • I am rjray (https://keybase.io/rjray) on keybase.
  • I have a public key whose fingerprint is 386C 5D8F ABF8 EC90 8A76 072B E7A2 50D8 2FDD 3C62

To claim this, I am signing this object:

@rjray
rjray / gist:1047323
Created June 26, 2011 06:37
Running Devel::Cover over a suite of tests
cover -delete
HARNESS_PERL_SWITCHES=-MDevel::Cover=-coverage,statement,branch,condition,path,subroutine,time prove -l
cover
@rjray
rjray / inotify.pl
Created May 8, 2009 02:05
Some playing-around with the Linux::Inotify2 Perl module, for tracking what/how many files are loaded as Perl runs.
#!/usr/bin/perl
# Playing around with acme's sample code around Linux::Inotify2.
# See http://acme.vox.com/library/post/what-files-does-your-perl-load.html
use strict;
use warnings;
use Linux::Inotify2;
use File::Find::Rule;
#!/bin/bash
# I use this to create a gh-pages branch on new repos
if [ ! -d .git ]; then
echo "Must be in a repository directory!"
exit
fi
wd_clean=$(git status | grep 'nothing to commit')