Skip to content

Instantly share code, notes, and snippets.

View redblobgames's full-sized avatar
🥰

Amit Patel redblobgames

🥰
View GitHub Profile
@redblobgames
redblobgames / my-notes.el
Last active January 31, 2022 23:09
My note taking setup in emacs
;;; 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.
@redblobgames
redblobgames / my-diary.el
Last active February 20, 2025 19:15
my journal code
;;; 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
redblobgames / main-legion.rs
Created November 5, 2020 17:22
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
redblobgames / trello-to-text.js
Created October 6, 2020 16:40
Output trello json to a hierarchical text file (org mode but could easily be markdown instead)
#!/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
redblobgames / fdg-2019.md
Last active September 2, 2019 20:45
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
redblobgames / x-section.xslt
Created July 27, 2019 14:23
Example of how I use xsltproc to expand section headings
<!--
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
redblobgames / dark-borders.el
Last active October 15, 2019 11:33
Emacs: dark fringe, line numbers
(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
redblobgames / my-modeline.el
Last active April 2, 2021 14:56
amitp's modeline summer 2019
;; 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
redblobgames / make-instagram-photos.sh
Created June 2, 2019 03:02
Turn a panoramic photo into several square photos for Instagram, so that when you scroll they look like one seamless photo
#!/bin/bash
# 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"
exit
fi
@redblobgames
redblobgames / INSTALL.CFG
Last active March 20, 2019 15:43
Configuration script in SRE 0.992a (SRE.CFG) vs SRE 0.993a (INSTALL.CFG)
;SRE
;Solar Realms Elite
;0.993a
let GAME := SRE
tell $GAME " " 0.993a " setup:"
if $doorfile == "" goto Local
getcwd CWD
tell "The " $GAME " directory is `" $CWD "'."