This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## | |
## Kosei Moriyama <[email protected]> | |
## | |
## Very naive script to build a firefox extension xpi file. | |
## | |
## Before you use this script, you should prepare chrome.manifest | |
## which supports the case that files in the chrome directory are | |
## compressed as .jar file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;; .emacs | |
;;; add ~/elisp/ to load-path | |
(setq load-path | |
(append | |
(list | |
(expand-file-name "~/.emacs.d/elisp") | |
(expand-file-name "/usr/share/emacs/site-lisp/w3m") | |
) | |
load-path)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## zsh confs | |
## via http://bloghackers.net/~naoya/webdb40/ | |
# auto complete | |
autoload -U compinit | |
compinit | |
# command history | |
HISTFILE=$HOME/.zsh-history | |
HISTSIZE=10000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## エスケープキーの設定 | |
escape ^Tt | |
## ビジュアルベルを無効 | |
vbell off | |
## ステータス行の設定 | |
hardstatus alwayslastline "[%02c] %`%-w%{=b bw}%n %t%{-}%+w" | |
## スタートアップ時メッセージ無効 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$BEGINCUT$ | |
$ENDCUT$ | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <map> | |
#include <algorithm> | |
#include <iostream> | |
#include <cstdio> | |
#include <cstdlib> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* toru.js | |
* Kosei Moriyama <[email protected]> | |
* | |
* Get selection area, traverse the area, obtain xpath of dom elements inside the area | |
* and send the xpath to torerundesu server. | |
* | |
* TODO: | |
* - Find cookies and check the user is logined or not. | |
* - Send results to the server. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* load-external-script-snippet.js | |
* Kosei Moriyama <[email protected]> | |
* | |
* Simple code snippet for loading external script from a bookmarklet. | |
* Replace example url of script to your target script url before use. | |
*/ | |
(function() { | |
var u = 'http://example.com/bookmarklet.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* script-loader.js | |
* Load external scripts one by one. | |
* (Load certain script after previous script is loaded.) | |
*/ | |
(function script_loader(scripts) { | |
if (scripts.length <= 0) return; | |
var uri = scripts.shift(); | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* scrape.js | |
* Code snippet to scrape web site using jquery. | |
* This code is from WEB+DB Press Vol.51 JavaScript 今ドキ活用術 by Shinichi Tomita | |
*/ | |
jQuery.noConflict(); | |
(function($) { | |
jQuery.fn.scrape = function(def) { | |
// get text value from DOM node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A = [5, 2, 4, 6, 1, 3] | |
for j in range(1, len(A)): | |
key = A[j] | |
i = j - 1 | |
while i >= 0 and A[i] > key: | |
A[i+1] = A[i] | |
i -= 1 | |
A[i+1] = key |