Skip to content

Instantly share code, notes, and snippets.

@h-hirai
h-hirai / .emacs.el
Last active September 4, 2018 04:17
My .emacs
;; ~/.emacs.d/init.el
;; basic editing
(defun scroll-n-lines-ahead (&optional n)
"Scroll ahead N lines (1 by default)."
(interactive "P")
(scroll-up (prefix-numeric-value n)))
(defun scroll-n-lines-behind (&optional n)
@h-hirai
h-hirai / httpserv.rb
Created August 28, 2009 05:51
Starting Webrick
#! /usr/bin/ruby
require 'webrick'
mimetypes = WEBrick::HTTPUtils::DefaultMimeTypes
mimetypes["js"] = "application/x-javascript"
mimetypes["svg"] = "image/svg+xml"
s = WEBrick::HTTPServer.new(:Port => 8000,
:DocumentRoot => Dir::pwd,