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
;; -*- mode: emacs-lisp; lexical-binding: t -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Layer configuration: | |
This function should only modify configuration layer settings." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory | |
;; `+distribution'. For now available distributions are `spacemacs-base' |
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
; auto-async-byte-compile | |
; (require 'auto-async-byte-compile) | |
; 対応する括弧を表示する | |
(show-paren-mode t) | |
; 起動するときに起動画面を表示しない | |
(setq inhibit-startup-message t) | |
(setq initial-scratch-message "") | |
;; ツールバーを非表示 |
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
(ns liar) | |
(defn with-liar* [exp] | |
(map (fn [sym] | |
(case sym | |
true 'false | |
false 'true | |
sym)) | |
exp)) |
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
(use gauche.process) | |
(use file.util) | |
(define *conf* `((gauche-repo . "https://github.com/shirok/Gauche.git") | |
(tmp-dir . "./tmp") | |
(gauche-dir . "/Gauche"))) | |
(define (main args) | |
(let* ((repo (assq-ref *conf* 'gauche-repo)) | |
(tmp (assq-ref *conf* 'tmp-dir)) | |
(proj-dir (string-append tmp |
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
($ for-each | |
(^x (twitter-update | |
*cred-test* | |
(string-append "Hello, world!!" | |
(x->string (integer->char x))))) | |
$ iota 138 128) |
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
(define (prisoner strtegy-1 strtegy-2) | |
(cond [(and strtegy-1 strtegy-2) (values -6 -6)] | |
[(or strtegy-1 strtegy-2) | |
(if strtegy-1 (values -0 -9) (values -9 -0))] | |
[(and (not strtegy-1) (not strtegy-2)) (values -1 -1)])) | |
(prisoner #t #t) | |
(prisoner #f #t) | |
(prisoner #t #f) | |
(prisoner #f #f) |
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
(use util.match) | |
(define (take p lst c) | |
(filter (lambda (x) (c p x)) | |
lst)) | |
(define (take-less p lst) | |
(take p lst >)) | |
(define (take-greater p lst) | |
(take p lst <)) |
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
(define (doctor-away-numbers? a b c) | |
(let ((b1 (div b 10)) | |
(b2 (mod b 10)) | |
(c1 (div c 10)) | |
(c2 (mod c 10))) | |
(and (= (+ (* (div b2 a) 10) | |
(/ (+ (* b1 10) (div b2 a)) a)) | |
c) |
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
(let loop ((p 10) (n 4)) | |
(cond [(= n 0) 0] | |
[(= n 1) p] | |
[else | |
(let in-loop ((c 1) (ans '())) | |
(cond [(<= p 1) c] | |
[(> c (- p n)) ans] | |
[else (in-loop (+ c 1) | |
(cons | |
`(,c ,@(loop (- p c) (- 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
#!/usr/local/bin/gosh | |
(use rfc.http) | |
(use rfc.uri) | |
(use rfc.json) | |
(use net.twitter) | |
(define *cred* (make <twitter-cred> | |
:consumer-key "XXXX" |
NewerOlder