Skip to content

Instantly share code, notes, and snippets.

View ayato-p's full-sized avatar
💪

ayato-p ayato-p

💪
  • UZABASE, inc.
  • Tokyo, Japan
  • 03:07 (UTC +09:00)
View GitHub Profile
;; -*- 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'
; auto-async-byte-compile
; (require 'auto-async-byte-compile)
; 対応する括弧を表示する
(show-paren-mode t)
; 起動するときに起動画面を表示しない
(setq inhibit-startup-message t)
(setq initial-scratch-message "")
;; ツールバーを非表示
@ayato-p
ayato-p / liar.clj
Created February 7, 2017 00:00
嘘吐き!
(ns liar)
(defn with-liar* [exp]
(map (fn [sym]
(case sym
true 'false
false 'true
sym))
exp))
@ayato-p
ayato-p / gauche-head-make.scm
Created May 21, 2013 15:07
GaucheのHEADをMakeするスクリプト
(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
@ayato-p
ayato-p / rentou.scm
Last active December 12, 2016 10:55
($ for-each
(^x (twitter-update
*cred-test*
(string-append "Hello, world!!"
(x->string (integer->char x)))))
$ iota 138 128)
(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)
(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 <))
(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)
(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)))
#!/usr/local/bin/gosh
(use rfc.http)
(use rfc.uri)
(use rfc.json)
(use net.twitter)
;; twitter
(define *cred* (make <twitter-cred>
:consumer-key "XXXX"