Skip to content

Instantly share code, notes, and snippets.

View BrandonIrizarry's full-sized avatar

Brandon Irizarry BrandonIrizarry

  • New York, New York
  • 06:45 (UTC -05:00)
View GitHub Profile
(defun bci/--screenshot-to-image-format (type)
"Save a screenshot of the current frame as a TYPE image, with
the appropriate file-extension.
TYPE should be given as a quoted symbol, as it is passed directly
to `x-export-frames'.
The result is saved to a temp file, with the filename placed also
in the kill-ring."
(let* ((file-extension
@BrandonIrizarry
BrandonIrizarry / build-emacs28.sh
Created November 27, 2022 15:32 — forked from abidanBrito/build-emacs.sh
Bash script to build GNU Emacs 28 from source.
#!/usr/bin/env bash
## Author: Abidán Brito
## This script builds GNU Emacs 28 with support for native elisp compilation,
## libjansson (C JSON library) and mailutils.
# Exit on error and print out commands before executing them.
set -euxo pipefail
# Let's set the number of jobs to something reasonable; keep 2 cores
@BrandonIrizarry
BrandonIrizarry / main.c
Created August 22, 2021 15:44
Week 3 Honors Assignment from Coursera Course "C For Everyone: Structured Programming"
/*
Brandon C. Irizarry
Create a doubly-linked list of 200 random integers in the range [0,
49]. Then, remove duplicates from this list.
Our strategy is to first sort the list, then remove duplicates by
scanning the sorted list in order, pushing non-repeated elements
onto a new list, and then returning this list.
@BrandonIrizarry
BrandonIrizarry / bubble_sort.c
Last active August 20, 2021 00:41
A minimal example of bubble sort, using a character array as an example. (C language practice.)
/*
Brandon C. Irizarry
8/19/21
Example of Bubble Sort (ascending order).
Upon studying this a bit further, I missed out on
an invariant of the sort.
(The array is always scanned from the beginning each time.)
@BrandonIrizarry
BrandonIrizarry / .Xresources
Created December 31, 2020 16:51
A minimal but useful Xterm configuration file.
! Make communicating with other applications via the clipboard easy
xterm*selectToClipboard: true
! Important - if you leave out 'renderFont', 'faceName' and such won't work. See:
! https://superuser.com/questions/463414/how-to-get-truetype-fonts-to-display-in-xterm-from-a-xresources-file/575108#575108
xterm*renderFont: true
xterm*faceName: monospace
xterm*faceSize: 20
! Some sample configuration settings, to test whether xterm was
@BrandonIrizarry
BrandonIrizarry / spongebob.c
Last active December 20, 2020 00:11
Use C to convert command-line arguments to Spongebob-case.
/*
Small, fun proof-of-concept:
Given a command-line string, convert each argument to
SpongeBob-case. Invoking './spongebob spongebob meme' prints
'sPoNgEbOb mEmE' to stdout.
*/
#include <stdio.h>
#include <ctype.h>
@BrandonIrizarry
BrandonIrizarry / debug_keycodes.c
Last active December 18, 2020 01:08
Small program to investigate handling multibyte keys in ncurses; based on another Github Gist.
/*
Adapted, with light modifications, from
https://gist.github.com/lesovsky/f0f5d31ac48f2fc53e5f
The original name of the program was, "ncurses-get-key-code.c".
The problem was the following:
BACKGROUND: