Skip to content

Instantly share code, notes, and snippets.

View liquidz's full-sized avatar
👶
hello world!

Iizuka Masashi liquidz

👶
hello world!
View GitHub Profile
(use file.util)
(define (keta-awase num keta)
(let* ((tmp (number->string num))
(len (string-length tmp))
)
(if (< len keta)
(string-append (make-string (- keta len) #\0) tmp)
tmp
)
(use simply)
(uses file.util srfi-1)
(define *get-class-name* '__get-class-name)
(define *set-value* '__set-value)
(define *set-function* '__set-function)
(define *ref-function* '__)
(define *receive-number* '_num)
(define *receive-symbol* '_sym)
(define *receive-string* '_str)
(use simply)
(uses gauche.interactive srfi-1)
(define *version* "0.01")
(define *default-functions*
(list
'+ (lambda x (apply + x))
'- (lambda x (apply - x))
'* (lambda x (apply * x))
@liquidz
liquidz / 99.rb
Created April 15, 2009 09:55
244byte
b=proc{|n,w|"#{n<1?'no more':n} bottle#{'s'if n!=1} of beer#{' on the wall'if w}"}
99.downto(0){|i|puts"#{b[i,0].capitalize}, #{b[i,p]}.\n#{i>0?'Take one down and pass it around, '+b[i-1,0]:'Go to the store and buy some more, '+b[99,0]}.\n\n"}
@liquidz
liquidz / nicotter.user.js
Created May 1, 2009 09:22
nicotter: greasemonkey script for posting NicottoTown mutter to Twitter
// ==UserScript==
// @name nicotter
// @version 0.01
// @namespace http://www.nicotto.jp
// @description post NicottoTown mutter to Twitter
// @author uochan (or liquidz@GitHub)
// @include http://www.nicotto.jp/user/mypage*
// ==/UserScript==
(function(){
// ==UserScript==
// @name nicomessage
// @namespace http://www.nifty.com
// @include http://www.nicotto.jp/user/mypage
// ==/UserScript==
(function(){
// =$
// ----------------------------------------------------
var $ = function(id){
@liquidz
liquidz / prototype.scm
Created May 22, 2009 09:42
まだ途中
(use simply)
(define (klass klass-name . init)
(define (k2s k)
(string->symbol (keyword->string k))
)
(let-keywords init ((initialize '())
(prototype (make-hash-table*))
)
@liquidz
liquidz / notify-twitter.scm
Created May 24, 2009 03:32
notify twitter updates with notify-send
#!/usr/bin/gosh
(use srfi-1)
(use srfi-13)
(use simply)
(use simply.sxml)
(use simply.notify)
;---------YOU CAN EDIT----------
(define *twitter-user* "hogehoge")
@liquidz
liquidz / nicobook.rb
Created June 1, 2009 10:17
nicobook.rb
require 'open-uri'
require 'kconv'
require 'rexml/document'
def make_url(aws_key, options)
res = "http://webservices.amazon.co.jp"
res += "/onca/xml?Service=AWSECommerceService"
res += "&AWSAccessKeyId=#{aws_key}"
res += "&SearchIndex=Books"
@liquidz
liquidz / rcss.rb
Created June 16, 2009 07:34
rcss.rb
# rcss.rb
class Array
def map
self.each_index do |i|
self[i] = yield(self[i])
end
end
end