Skip to content

Instantly share code, notes, and snippets.

View ayato-p's full-sized avatar
💪

ayato-p ayato-p

💪
  • UZABASE, inc.
  • Tokyo, Japan
  • 14:38 (UTC +09:00)
View GitHub Profile
(print "あやぴーダヨー")
body {
margin: 0;
padding: 0;
background: #151515 url("bkg.png") 0 0;
color: #eaeaea;
font: 16px;
line-height: 1.5;
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
}
/* General & 'Reset' Stuff */
@ayato-p
ayato-p / jade-ftw.md
Created September 23, 2013 07:27 — forked from japboy/jade-ftw.md

Jade FTW

こんにちは。今回は現実逃避を兼ねて Jade の素晴らしさをお伝えしたいと思います。

Jade とは何か

[Jade][0] は JST (JavaScript Templates) の一つであり、HTML を書くための[軽量マークアップ言語][1] である [Haml][2] に影響を受けた JavaScript テンプレートエンジンでもあります。

#!/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"
(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)))
(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)
(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 (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)
@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)
; auto-async-byte-compile
; (require 'auto-async-byte-compile)
; 対応する括弧を表示する
(show-paren-mode t)
; 起動するときに起動画面を表示しない
(setq inhibit-startup-message t)
(setq initial-scratch-message "")
;; ツールバーを非表示