Skip to content

Instantly share code, notes, and snippets.

@uraraurara
uraraurara / 256colors.lua
Created October 28, 2012 09:57
a port of 256colors.pl in lua see: xterm's folder
opt_h, opt_q, opt_r = false, false, false
function map_cube(v)
if opt_r then return 5 - v end
return v
end
function map_gray(v)
if opt_r then return 23 - v end
return v
end
@uraraurara
uraraurara / node.el
Created October 5, 2012 16:03
javascript environment in emacs with node
;; http://stackoverflow.com/questions/6605058/what-are-these-shell-escape-characters
;; the following assumption:
;; * using nodebrew
;; * major version of emacs is above 24
;; ----
;; A. Do package-install js-comint
;; B. Create shell file `node2' at ~/.nodebrew/current/bin/node2 and chmod +x node2
#!/bin/sh
@uraraurara
uraraurara / dijkstra.lua
Created October 4, 2012 02:43
dijkstra in lua
require('dumper')
function dump(...)
print( DataDumper(...), "\n---")
end
path = { {},{},{},{},{},{}}
dpath = {}
dpath[1] = { {2, 5}, { 6, 4}, {5,2} }
dpath[2] = { {3, 6}, {6, 2}, }
dpath[3] = { {4, 4} }