View copy-and-rename.sh
for file in crushed-*; do cp "$file" "${file/crushed-/}"; done
View test-layout.sh
#!/bin/bash
# Clear rbenv variables before starting tmux
unset RBENV_VERSION
unset RBENV_DIR
tmux start-server;
cd .
View test-layout.yml
# /home/peter/.config/tmuxinator/test-layout.yml
name: test-layout
windows:
- email:
panes:
- echo zero
- echo one
- echo two
- echo three
View layout.md
  • manually create your layout
  • run either tmux list-windows outside of your session or run list-windows from inside your session in the (tmux) command prompt
  • the output will contain a substring like: [layout e1ce,158x43,0,0{79x43,0,0,1,78x43,80,0[78x10,80,0,2,78x10,80,11,5,78x10,80,22,3,78x10,80,33,4]}]
  • copy/massage the substring to look like the following and you should be set:
windows:
  - editor:
      layout: e1ce,158x43,0,0{79x43,0,0,1,78x43,80,0[78x10,80,0,2,78x10,80,11,5,78x10,80,22,3,78x10,80,33,4]}
View yield_self_demo.rb
modified_str = "foo"
.yield_self { |str| str.split('') }
.yield_self { |str| str.join('-') }
.yield_self(&:upcase)
.yield_self { |str| "#{str}!" }
puts modified_str # F-O-O!
View default.html
<!doctype html>
<html lang="en">
<head>
<title>$title$ - peterdohertys.website</title>
$if(css)$
<link rel="stylesheet" href="/css/$css$.css" />
$endif$
</head>
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!)
View README.md

Deploy

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 =
foldr
(\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;