Skip to content

Instantly share code, notes, and snippets.

@mkamotsu
mkamotsu / .sumpwmrc
Created October 28, 2013 14:01
いつもの
(in-package stumpwm)
(defcommand itsumono () ()
"Start itumono with layout"
(restore-from-file "~/.stumpwmrc.d/logbook.layout")
(restore-window-placement-rules "~/.stumpwmrc.d/logbook.rule")
(run-shell-command "firefox-bin")
(run-shell-command "logbook")
(run-shell-command "mikutter"))
@mkamotsu
mkamotsu / .stumpwmrc
Created October 28, 2013 15:09
レイアウトの覚書用
;; -*-lisp-*-
(in-package :stumpwm)
(defmacro define-ror (name command class)
`(defcommand ,name () ()
,(concatenate 'string
"Start " command
" unless it is already running, in which case focus it.")
(run-or-raise ,command '(:class ,class))))
@mkamotsu
mkamotsu / init.el
Created October 28, 2013 15:11
Emacs24用.依存を出来るだけ少なくした. TODO: quicklisp/slime-helper.elもどうにかする.
(custom-set-variables
'(inhibit-startup-screen t)
'(initial-scratch-message nil))
(custom-set-faces)
(show-paren-mode t)
(load (expand-file-name "~/.quicklisp/slime-helper.el"))
(setq inferior-lisp-program "ccl")
(setq slime-net-coding-system 'utf-8-unix)
@mkamotsu
mkamotsu / init.el
Created October 30, 2013 00:07
以前のやつをマージ
(custom-set-variables
'(custom-enabled-themes (quote (tsdh-dark)))
'(inhibit-startup-screen t)
'(initial-scratch-message nil))
(custom-set-faces)
(set-frame-font "VL Gothic-10")
(setq skk-kutouten-type 'en)
(setq-default tab-width 4
indent-tabs-mode nil)
(setq browse-url-browser-function 'browse-url-firefox)
@mkamotsu
mkamotsu / hello.c
Last active December 26, 2015 23:08
hello, world派
#include <stdio.h>
int main(void) {
printf("hello, world\n");
return 0;
}
@mkamotsu
mkamotsu / init.el
Last active April 25, 2017 21:05
Clojure環境の設定
;; 対応する括弧の強調表示
(show-paren-mode t)
;; Emacs24標準のパッケージマネージャ
;; 必要なパッケージをインストール
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(when (not package-archive-contents)
@mkamotsu
mkamotsu / argstring.cpp
Created November 8, 2013 04:24
Are there any tricks to use std::cin to initialize a const variable? http://stackoverflow.com/questions/12279601/are-there-any-tricks-to-use-stdcin-to-initialize-a-const-variable をコマンドライン引数で使う.
#include <iostream>
#include <functional>
#include <sstream>
namespace my {
std::string argstring(int argc, char *argv[]) {
std::ostringstream oss;
for (int i=1; i<argc; ++i)
oss << argv[i] << ' ';
return std::move(oss.str());
@mkamotsu
mkamotsu / hello.cgi
Created November 25, 2013 08:06
CGI
#!/bin/sh
echo "content-type: text/html"
echo ""
echo "<html>"
echo "<head>"
echo "<title>テスト</title>"
echo "</head>"
echo "<body>"
uname -a
(ns bdb.core
(:require [clojure.java.io :as io])
(:import (com.sleepycat.db DatabaseException
DatabaseConfig
DatabaseType
DatabaseEntry
Database
OperationStatus)
(java.io FileNotFoundException
IOException))
@mkamotsu
mkamotsu / FizzBuzz.pl
Created August 28, 2015 16:47
アセンブリっぽいFizzBuzz
use strict;
use warnings;
my $r;
my @s;
$r = 1;
LOOP:
goto EXIT if ($r > 100);
push @s, $r;