View console
#!/usr/bin/env ruby
# frozen_string_literal: true
require "bundler/setup"
require "tmuxinator"
# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
# (If you use this, don't forget to add pry to your Gemfile!)


stack exec deploy

View dedupe-nested-lists.hs
-- [[1,2],[2,3],[4,5]] becomes [[1,2],[3],[4,5]]
-- this file can be run using: `stack runghc dedupe-nested-lists.hs`
dedupe_against_self =
(\member memo ->
if (any (== member) memo)
then memo
else member : memo)
View rewind-string-pointer.c
// run with: `gcc main.c -include stdio.h && ./a.out`
int main() {
char *foo = "foo";
char *bar = foo;
char *begin = bar;
while (*bar++) {}
bar = begin;
printf("%s\n", bar); // foo
return 0;




I stayed in Bondi Junction (where Eddie was living at the time), which is a ways out from the hustle-and-bustle downtown. There are great views of the opera house, Sydney Harbor Bridge and Bondi Beach is within walking distance.

Bondi Beach is a renowned surf spot and, in addition to beach activities, there are lots of nice cliffs to hike around on on the far-side of the beach.

View haml-inline-partial-helper.rb
- delete_button = haml_tag :a,
class: "close story-item-image-delete",
href: "javascript: void(0);",
tabindex: "-1",
title: "delete image" do
View code-world-example.hs
{-# LANGUAGE OverloadedStrings #-}
import CodeWorld
main = do
let animFunc = (\x -> rotated x $ rectangle (x * x) (x * 3))
expand = (\x y -> x + y)
contract = (\x y -> x - y)
step = (\x y -> if y > 4 then (contract x y) else (expand x y))
View print_words.c
void print_words(char **words) {
for (; *words; words++) {
char *word = *words;
while (*word) {
View demo.c
#include <stdio.h>
typedef void (*thing_sayer)(char *person);
void say_hello(char *person) {
printf("Hello, %s!\n", person);
void say_goodbye(char *person) {
printf("Goodbye, %s!\n", person);

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
# or, instead of backing up trustdb...