Skip to content

Instantly share code, notes, and snippets.

Avatar
👶
hello world!

Iizuka Masashi liquidz

👶
hello world!
View GitHub Profile
@liquidz
liquidz / _onload.js
Created Sep 24, 2008
js for multiple onload funcs
View _onload.js
/* ------------------------------------
javascript function
for multiple onload functions
------------------------------------ */
function _onload(func){
var tmp = (window.onload == undefined) ? null : window.onload;
window.onload = function(){
if(tmp != null) tmp();
func();
@liquidz
liquidz / simply.scm
Created Sep 24, 2008
simply.scm) gauche module to write code simply
View simply.scm
; gauche module to write code simply
(define-module simply
(use srfi-1)
(use srfi-13)
(use rfc.http) (use rfc.uri) (use rfc.base64) (use file.util)
(use gauche.charconv) (use gauche.process)
(export-all)
)
(select-module simply)
@liquidz
liquidz / isbn.rb
Created Sep 24, 2008
ruby class for ISBN
View isbn.rb
class ISBN
attr_reader :isbn
# =initialize
def initialize(isbn)
@isbn = isbn.strip.gsub(/[\s\-]/, "")# {{{
@type = nil
@type_checked = false
end# }}}
@liquidz
liquidz / gist-search.user.js
Created Sep 25, 2008
opera user js for searching gist
View gist-search.user.js
// ==UserScript==
// @include http://gist.github.com/*
// ==/UserScript==
(function(){
var $ = function(id){
return document.getElementById(id);
};
var classLoop = function(tag_name, class_name, func){
var tags = document.getElementsByTagName(tag_name);
@liquidz
liquidz / csv.scm
Created Sep 30, 2008
reading csv funcs for gauche
View csv.scm
(use file.util)
(use simply)
; =make-csv-row-name-hash
(define (make-csv-row-name-hash row);{{{
(let1 hs (make-hash-table)
(let loop((ls row) (i 0))
(cond
[(null? ls)
hs
View gist:18511
Global setup:
Download and install Git
git config --global user.email ***@***.com
Next steps:
mkdir opera-widgets
cd opera-widgets
git init
touch README
git add README
View replace.sh
#!/bin/sh
# script for replacing multiple files
#
# usage: ./replace.sh [directory] [filter] [before] [after]
#
# ex) replace "e" to "a" for all htm/html file in current dir
# # ./replace . 'html?$' e o
if [ $# -eq 0 ]
then
View wuc.scm
(use gauche.process)
(use rfc.uri)
(use simply)
(define *open-uri-command* "start")
(define *config-file-name* "wuc.conf")
; =read-config
; -------------------------------------------------------
(define (read-config)
View sgwf.scm
#|
| Simple Gauche Web Framework
|#
(define-module sgwf
(use www.cgi)
(use text.html-lite)
(use sxml.serializer)
(use gauche.interactive)
(use simply)
View isbn.scm
(define-module isbn
(use simply)
(export get-isbn-type isbn10->isbn13 isbn13->isbn10)
)
(select-module isbn)
#| *-- PUBLIC --*
|#
; =get-isbn-type