Skip to content

Instantly share code, notes, and snippets.

@dahu
dahu / gist:3986511
Last active April 22, 2024 13:02
Vim Motions
Large Object Motions:
(
)
{
}
[[
[]
][
]]
[m
@dahu
dahu / epictetus.adoc
Created October 12, 2014 05:08
Epictetus quotes

Epictetus

Philosophy is a way of life and not just a theoretical discipline.

Epictetus (55 — 135 AD) was a Greek slave of Rome. He became a great Stoic philosopher and teacher, and was eventually freed.

Although he was a fatalist, he believed that individuals are responsible for their own actions, which they can examine and control through rigorous self-discipline.

@dahu
dahu / weight-loss.md
Last active August 3, 2022 13:20
Weight Loss Plan

Weight Loss Plan

Barry Arthur barry.arthur@gmail.com

1.0, 2014-06-19 19:48

  • Current weight : kg
  • Goal : kg
  • Diet Duration : 4 - 8 weeks (expect a loss of between 1.0 - 0.5 kg per week)
  • Expect visible results within 2 weeks (better fitting clothes, for example)
@dahu
dahu / gist:4431644
Created January 2, 2013 02:18
Starting Vim in NORC mode when using pathogen
" ~/.vim/pathogen_norc
" Barry Arthur, Jan 2013
" To start your vim in NORC mode, use: vim -u ~/.vim/pathogen_norc.vim
set nocompatible
call pathogen#infect()
filetype plugin indent on
syntax on
@dahu
dahu / gist:5f87d130ca8986ea95d6
Created June 22, 2015 03:57
The naive beginnings of a toy hex editor in Vim
" Barry Arthur, June 2015
" The start of a Hex editor in Vim
function! HexInit()
let lines = getline(1, '$')
let s:idx = []
let s:hex = []
let s:asc = []
for l in lines
call add(s:idx, strpart(l, 0, 8))
@dahu
dahu / fossil_name.sh
Created August 6, 2017 08:16
Script to set a fossil repository's project-name and description fields
#!/bin/sh
# Attribution: unknown. Probably taken from the fossil-users mailing list.
usage() { echo usage: $0 'archive.fossil "project name" "project description"' ; exit 1 ; }
dbname="$1"
pname="$2"
pdesc="$3"
@dahu
dahu / gist:39282c57bba5b2d1e7b1
Last active February 25, 2017 19:33
Choose Your Own Vim Adventure -- Goal Driven Learning for Vim

Goal Driven Learning for Vim

Principles

@dahu
dahu / gist:2917493
Created June 12, 2012 13:25
sanitized & sorted list of vimgor requests on #vim between 2010-07-03 to 2012-06-12
129 tabs
117 smartindent
104 buffers
93 nohl
93 csapprox
92 anyone
78 indent
77 vim-tiny
75 doesn't work
69 movement
@dahu
dahu / ack.red
Created October 10, 2016 06:28
Ackerman function causes stack overflow in Red (and not Rebol)
Red []
; https://rosettacode.org/wiki/Ackermann_function
ack: func [m n] [
case [
0 = m [n + 1]
0 = n [ack m - 1 1]
true [ack m - 1 ack m n - 1]
]
]
;
@dahu
dahu / roman.rebol
Created October 7, 2016 03:22
Adaptation of Java+ANTLR Roman Number parser in Rebol
Rebol []
; Parse Roman Numerals
; Barry Arthur, 2016-10-07
; From Nigel Galloway's Java + ANTLR version, March 16th, 2012
; (https://www.rosettacode.org/wiki/Roman_numerals/Decode#ANTLR)
;
inc: func ['word amount] [set word amount + get word]
inc1: func ['word] [inc :word 1]
;
parseRN: [(number: 0 err: copy "") rn]