Skip to content

Instantly share code, notes, and snippets.


Eitaro Fukamachi fukamachi

View GitHub Profile
fukamachi / gist:2514290
Created Apr 27, 2012
Clack uploading sample
View gist:2514290
(import 'clack.request:make-request 'clack.request:body-parameter)
#'(lambda (env)
(format t "~S~%"
(body-parameter (make-request env)))
(:content-type "text/html")
("<form method='POST' enctype='multipart/form-data'><input type='file' name='pdf'><input type='submit'></form>"))))
fukamachi / inverse-fizzbuzz.lisp
Created May 17, 2012
Inverse FizzBuzz in Common Lisp
View inverse-fizzbuzz.lisp
(ql:quickload :optima)
(ql:quickload :alexandria)
(ql:quickload :cl-test-more)
(setq *print-circle* t)
fukamachi / gist:3964573
Created Oct 27, 2012
Tutorial of cl-string-complete
View gist:3964573

This is a tutorial of cl-string-complete.

CL-USER> (ql:quickload :cl-string-complete)
To load "cl-string-complete":
  Install 1 Quicklisp release:
; Fetching #<URL "">
; 5.14KB
fukamachi / gist:4109258
Last active May 27, 2016
Pretty lambda/nil for Emacs
View gist:4109258
;; This function is quoted from this page. Thanks to Tomohiro Matsuyama.
(defun set-pretty-patterns (patterns)
(loop for (glyph . pairs) in patterns do
(loop for (regexp . major-modes) in pairs do
(loop for major-mode in major-modes do
(let ((major-mode (intern (concat (symbol-name major-mode) "-mode")))
(n (if (string-match "\\\\([^?]" regexp) 1 0)))
(font-lock-add-keywords major-mode
`((,regexp (0 (prog1 ()
fukamachi / gist:4109289
Created Nov 19, 2012
Make the color of parenthesis gray.
View gist:4109289
(defvar paren-face 'paren-face)
(make-face 'paren-face)
(set-face-foreground 'paren-face "#666666")
(dolist (mode '(lisp-mode
(font-lock-add-keywords mode
'(("(\\|)" . paren-face))))
fukamachi /
Last active Dec 12, 2015
LESS watch & compile.
import os
import re
import shutil
import time
import sys
from watchdog.observers import Observer
from watchdog.tricks import Trick
fukamachi / gist:4744978
Created Feb 9, 2013
Toodledo Redesigned
View gist:4744978
@charset "UTF-8";
body {
font-family: "Trebuchet MS", Arial, Helvetica, san-serif;
background: none;
#logo {
width: 120px;
height: 27px;
fukamachi / gist:5545090
Last active Dec 17, 2015
View gist:5545090
/* <system section="theme" selected="11696248318752473050"> */
@import url("");
/* </system> */
/* <system section="background" selected="a5b095"> */
/* </system> */
/* ↓の部分を追加 */
.entry-content p {
fukamachi /
Last active Dec 20, 2015
$(function() {
$('.section h3').each(function() {
var entry = $(this);
var permalink = entry.find('a').first().attr('href');
$.get(permalink + '?mode=json').success(function(data) {
var button = $('<button>').text('コピー');
button.on('click', function() {
window.prompt("Copy to clipboard: Ctrl+C, Enter", data['body']);
View git-blame-current-line.el
(defun git-blame-current-line ()
(let ((blame-result
(format "git blame -p -L %d,+1 %s" (line-number-at-pos) (buffer-file-name))))
(result (make-hash-table :test 'equal)))
(loop with (commit . lines) = (split-string blame-result "\n")
for line in lines
for (key . values) = (split-string (or line "") " ")
do (setf (gethash key result) (mapconcat 'identity values " "))
You can’t perform that action at this time.