Skip to content

Instantly share code, notes, and snippets.

@DestyNova
DestyNova / resurrectff-closedwindow.lua
Created September 8, 2013 21:31
Swap the open and closed windows in Firefox's saved session file (sessionstore.js). Needs the extremely fast ''dkjson'' library (the session file is a big JSON string).
json = require('dkjson')
function main(max_depth)
print('Reading file...')
local session = assert(io.open('sessionstore.js', 'r'))
local session_data = session:read('*all')
print('Parsing ('..#session_data..' bytes)...')
local obj, pos, err = json.decode(session_data, 1, json.null)
if err then error(err) end

Keybase proof

I hereby claim:

  • I am destynova on github.
  • I am omf (https://keybase.io/omf) on keybase.
  • I have a public key ASBMi5I2PJPEeuiujfs-Mf6HnafUru6A_YiwRvpJmcb_2Qo

To claim this, I am signing this object:

@DestyNova
DestyNova / .zprofile
Last active March 26, 2018 21:50
Handy aliases/miniscripts (in zsh format)
# load existing pre-zsh profile
emulate sh -c '. ~/.profile'
# make a directory and cd into it
mkd () { mkdir $1 && cd $1 }
# verbally remind me of something after N minutes
# Examples:
# $ remind_after 5 tea
# $ remind_after 25 "pomodoro break"
@DestyNova
DestyNova / tw5-server.rb
Last active March 22, 2022 23:32 — forked from jimfoltz/tw5-server.rb
A local server for TiddlyWiki5 that allows saving wiki.
require 'webrick'
require 'fileutils'
if ARGV.length != 0
root = ARGV.first.gsub('\\', '/')
else
root = '.'
end
BACKUP_DIR = 'bak'
BACKUP_VERSIONS = 3
@DestyNova
DestyNova / mount-hdi.sh
Last active July 24, 2022 00:26
Mount PC-98 hard disk image (.hdi) in ./mnt
#!/usr/bin/env bash
# Commands taken from this very helpful guide:
# https://github.com/drojaazu/pc98_disks_in_linux/blob/main/README.md#mounting-hard-disks
set -euo pipefail
IMAGE=$1
mkdir mnt