Skip to content

Instantly share code, notes, and snippets.

View youz's full-sized avatar
🈳
kyomu

Yōsuke Ushiki youz

🈳
kyomu
View GitHub Profile
@youz
youz / filter.rb
Last active August 29, 2015 13:57 — forked from melborne/filter.rb
class Filter
class << self
def filters
@filters ||= {}
end
def add(name, &code)
filters[name] = code
end
end
@youz
youz / buffer-bar-scroll.l
Last active August 29, 2015 13:57
マウス右ボタン押しながらホイール操作でバッファ切り替え #xyzzy
;;; マウス右ボタン押しながらホイール操作でバッファ切り替え
(eval-when (:compile-toplevel :load-toplevel :execute)
(require "foreign"))
(defpackage :buffer-bar-scroll
(:use :lisp :editor))
(in-package :buffer-bar-scroll)
@youz
youz / 256w.d
Created May 6, 2014 14:31
Grass to D sample : 256回'w'を出力するやつ
(new F(delegate V(V f3) {
return (new F(delegate V(V f4) {
return (new F(delegate V(V f5) {
return (new F(delegate V(V f6) {
return (new F(delegate V(V f7) {
return f7(f7);
}))(f6(w));
}))(f5(writer));
}))(f4(f4));
}))(f3(f3));
@youz
youz / hello.d
Created May 6, 2014 14:32
Grass to D sample : hello world
(new F(delegate V(V f5) {
return (new F(delegate V(V f9) {
return (new F(delegate V(V f10) {
return (new F(delegate V(V f11) {
return (new F(delegate V(V f15) {
return (new F(delegate V(V f17) {
return (new F(delegate V(V f18) {
return (new F(delegate V(V f19) {
return (new F(delegate V(V f20) {
return (new F(delegate V(V f21) {
@youz
youz / bonjovi.l
Last active August 29, 2015 14:02
bonjovi in CommonLisp
;;; https://twitter.com/yagiyyyy/status/473405016540053504/photo/1
(defun bonjovi ()
(loop
:with buf := #(t t t)
:for n :from 0
:for w := (format nil "~A~A" #0=(nth (random 4) '("ジョ" "ン" "ボ" "ヴィ")) #0#)
:until (equalp buf #("ジョン" "ボン" "ジョヴィ"))
:do (format t "~[~:;・~]~A" n w)
(shiftf (aref buf 0) (aref buf 1) (aref buf 2) w)
@youz
youz / Swift
Last active August 29, 2015 14:02
swift-mode for #xyzzy
;; keyword file for Swift
;; Keywords used in declarations:
;*0
class
deinit
enum
extension
func
import
Param(
[parameter(Mandatory=$true)]
[String]$tag
)
$OutputEncoding = [System.Text.Encoding]::UTF8
irm "http://qiita.com/tags/$tag/feed" | %{$_.title + "`0" + $_.url} | peco --null | %{start $_}
@youz
youz / tatsuzine.ps1
Created June 26, 2014 08:55
powershellから達人出版会の新刊をpecoで選ぶやつ
param([switch] $All)
$OutputEncoding = [System.Text.Encoding]::UTF8
$c = if ($All) { "all" } else { "new" }
irm "http://tatsu-zine.com/catalogs/$c.opds" |
%{$_.title + "`0" + ($_.link | where {$_.rel -Match "/buy"}).href} |
peco --null |
@youz
youz / test.lisp
Last active August 29, 2015 14:06
format-byte-size
;; ref. http://msdn.microsoft.com/en-us/library/windows/desktop/bb759975(v=vs.85).aspx
(defun format-byte-size (n)
(labels ((rec (n units)
(cond ((null units))
((< n 10)
(format nil "~,2f~a" n (car units)))
((< n 100)
(format nil "~2,1f~a" n (car units)))
((< n 1000)
(format nil "~d~a" (floor n) (car units)))
(prn(if(re-seq #"^(OO)*X?(OO)*$"(apply str(repeatedly 30 read-line)))'yes 'no))