Skip to content

Instantly share code, notes, and snippets.


Amit Patel redblobgames

View GitHub Profile
redblobgames / my-notes.el
Last active Mar 9, 2021
My note taking setup in emacs
View my-notes.el
;;; my-notes.el ---
;;; Commentary:
;; My notes, inspired by org-roam, but built on other packages I already use.
;; 1. Capture into a queue (org-capture)
;; 2. Review queue (org-agenda)
;; 3. Find note (find-file in folder).
;; 4. Make new note. Fill with title, date.
View my-diary.el
;;; my-diary.el ---
;;; Commentary:
;; My daily diary, inspired by org-journal, but customized for my needs.
;; My keybindings: H-j to open the diary file (global binding), then
;; H-j to add an entry (local binding). C-c C-b, C-c C-f to move days
;; (like org-journal). H-i to search previous headings for completion,
;; so that I can reuse headings and then analyze them.
redblobgames /
Created Nov 5, 2020
Experiment: Legion ECS vs using Rust enum + pattern matching
use legion::*;
use rltk::{GameState, Rltk, VirtualKeyCode, RGB};
use std::cmp::{max, min};
mod map;
pub use map::*;
struct Player {}
#[derive(PartialEq, Copy, Clone)]
redblobgames / trello-to-text.js
Created Oct 6, 2020
Output trello json to a hierarchical text file (org mode but could easily be markdown instead)
View trello-to-text.js
#!/usr/bin/env node
* I want to convert trello to a hierarchical text file (org mode)
* Trello can export to json. Save that json to a file. Then run this program.
* Notes about format:
redblobgames /
Last active Sep 2, 2019
FDG 2019 - abstracts of the papers

SESSION: Applied games and gameful design

Knowledge assessment: game for assessment of symptoms of child physical abuse Richard Zhao, Christopher R. Shelton, Melanie D. Hetzel-Riggin, Jordan LaRiccia, Gregory Louchart, Adam Meanor, Heather J. Risser Article No.: 1 doi>10.1145/3337722.3337747

Using serious games as a form of training and education has been a growing trend. While there has been research into the adaptation of games for training, assessment of user knowledge as a whole for the purpose of creating tailored training content has not been closely examined. In this paper, we propose a general framework for creating an assessment game and show how Knowledge Assessment can be used to guide the focus of subsequent training modules. Using our framework, we address the frustration and anxiety expressed by medical and nursi

redblobgames / x-section.xslt
Created Jul 27, 2019
Example of how I use xsltproc to expand section headings
View x-section.xslt
I write my site with xhtml extended with my x: tags, then process it into
regular html using xsltproc. Here's an example of how I use xslt for sections.
1. Expand x: tags to a standard html tag:
<x:section> … </x:section> becomes <section> … </section>
2. Pass attributes down to the html tag:
<x:section class="example"> … </x:section>
becomes <section class="example"> … </section>
redblobgames / dark-borders.el
Last active Oct 15, 2019
Emacs: dark fringe, line numbers
View dark-borders.el
(set-face-attributes 'header-line nil :inherit 'sample :foreground "gray70" :background "gray20")
(set-face-attributes 'fringe nil :foreground "gray70" :background "gray20")
(cl-loop for buffer in '(" *Echo Area 0*" " *Echo Area 1*") do
(with-current-buffer buffer
(face-remap-add-relative 'default '(:family "Muli" :background "gray20" :foreground "white"))))
(set-face-attributes 'line-number nil :family "M+ 1m" :height 0.6 :foreground "#ccc" :background "gray20")
(set-face-attributes 'line-number-current-line nil :inherit 'line-number :foreground "white" :background "blue")
(when (fboundp 'global-display-line-numbers-mode)
(setq-default display-line-numbers-width 4)
redblobgames / my-modeline.el
Last active Apr 2, 2021
amitp's modeline summer 2019
View my-modeline.el
;; You'll need to have the s and powerline packages installed for this modeline to work
(require 's)
(require 'powerline)
(defvar my/mode-line-border 8)
(defvar my/modeline-height 22)
(set-face-attribute 'mode-line nil :family "M+ 1m" :height 120
:background "gray20" :foreground "white"
:weight 'normal
redblobgames /
Created Jun 2, 2019
Turn a panoramic photo into several square photos for Instagram, so that when you scroll they look like one seamless photo
# As of 2017 Feb, Instagram allows multiple photos to be posted side by side.
# @idealisms posted some panoramas split up into separate photos.
# I wrote this script to generate those square photos from a panorama.
if [ -z "$1" ]; then
echo "Usage: $0 filename.jpg"
redblobgames / INSTALL.CFG
Last active Mar 20, 2019
Configuration script in SRE 0.992a (SRE.CFG) vs SRE 0.993a (INSTALL.CFG)
;Solar Realms Elite
let GAME := SRE
tell $GAME " " 0.993a " setup:"
if $doorfile == "" goto Local
getcwd CWD
tell "The " $GAME " directory is `" $CWD "'."