This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | |
] | |
] | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rebol [ | |
Title: "Roman Numbers" | |
Source: "Thinking in Forth (Ans, 2004) by Leo Brodie, Figure 4.9, Page 153" | |
] | |
romans: [I V X L C D M] | |
col: 0 | |
ones: does [col: 1] | |
tens: does [col: 3] | |
hundreds: does [col: 5] | |
thousands: does [col: 7] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/colors/jellybeans.vim b/colors/jellybeans.vim | |
index f9d5397..a1535ec 100644 | |
--- a/colors/jellybeans.vim | |
+++ b/colors/jellybeans.vim | |
@@ -275,9 +275,15 @@ fun! s:X(group, fg, bg, attr, lcfg, lcbg) | |
else | |
let l:fge = empty(a:fg) | |
let l:bge = empty(a:bg) | |
+ let l:lcfge = empty(a:lcfg) | |
+ let l:lcbge = empty(a:lcbg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" (ab)using the command message window for function signatures | |
" Barry Arthur, Oct 2015 | |
function! Signature(msg) | |
let m = filter(string#scanner(a:msg).split('.\{80}', 1), 'v:val != ""') | |
let len = len(m) | |
let msg = join(m, "\n") | |
let old_cmdheight = &cmdheight | |
let &cmdheight = len | |
echo msg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Messing with interfaces | |
" Barry Arthur, Oct 2015 | |
function! Foo() | |
let obj = {} | |
func obj.register(a, b) | |
echo string(a:a) . ' and ' . string(a:b) | |
endfunc | |
return obj | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Barry Arthur Sep 2015 | |
" Convert possibly repeating key\tvalue pairs into key\tvalue1,value2,... | |
function! CollapsePairs() | |
let stuff = {} | |
g/\t/let pair = split(getline('.'), '\t') | let stuff[pair[0]] = add(get(stuff, pair[0], []), pair[1]) | d | |
call append('$', map(sort(items(stuff)), 'v:val[0] . "\t" . join(v:val[1], ",")')) | |
endfunction | |
call CollapsePairs() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Barry Arthur 2015-9-8 | |
" Example statusline function collecting annotations from buffer | |
" embedded annotations are expected to be enclosed in square brackets | |
" and all upper-case, as in: | |
" [DESIGN] | |
" [IMPLEMENTATION] | |
" [NAMING] | |
" [OVERALL] | |
" [STYLE] |
NewerOlder