Skip to content

Instantly share code, notes, and snippets.

@azmr
azmr / vimrc
Last active August 29, 2015 13:57
" Preamble {{{
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
" let path='~/.vim/bundle'
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
;; User keymap
;; -----------------------------
;; Keymaps are stored as a set of diffs that are merged together to create
;; the final set of keys. You can modify these diffs to either add or
;; subtract bindings.
;;
;; Like behaviors, keys are bound by tag. When objects with those tags are active
;; the key bindings are live. Keys can be bound to any number of Light Table commands,
;; allowing you the flexibility to execute multiple operations together. To see a list
;; of all the commands you can execute, start typing a word related to the thing you
;; User behaviors
;; -----------------------------
;; Behaviors are stored as a set of diffs that are merged together
;; to create the final set of functionality that makes up Light Table. You can
;; modify these diffs to either add or subtract functionality.
;;
;; Behaviors are added to tags, objects with those tags then automatically gain
;; whatever logic the behavior imparts. To see a list of user-level behaviors,
;; start typing a word related to the functionality you want in between the square
;; brackets (e.g. "theme").
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser = pavan.sss1991@gmail.com
@azmr
azmr / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/bin/bash
function hcenter {
text="$1"
cols=`tput cols`
IFS=$'\n'$'\r'
for line in $(echo -e $text); do

% Undo, redo and units of interaction

I don't think I'm doing anything revolutionary with my undo system, but hopefully making the reasoning behind it very explicit will elucidate any missing steps in the reader's or my thinking.

A large part of this is trying to define 'units of interaction' for the user and then matching that to what can be robustly determined and stored in the software.

I describe this here as a roughly linear sequence for the sake of clarity. In reality the process was more iterative, and broadly follows Casey Muratori's Semantic Compression approach.

@azmr
azmr / launchpad.c
Last active September 12, 2022 22:22
Windows MIDI experimentation for I/O with Novation Launchpad (Mini)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
/* #include <basetsd.h> */
/* #include <windef.h> */
/* #include <winnt.h> */
#include <mmsystem.h>
#pragma comment (lib, "winmm.lib")
#pragma comment (lib, "user32.lib")
#include <mmreg.h>