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
#! /usr/bin/perl | |
use strict; | |
use warnings; | |
use Getopt::Long; | |
use Pod::Usage; | |
my $man = 0; | |
my $help = 0; | |
# my $port = 0; |
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
#! /usr/bin/perl | |
use strict; | |
use warnings; | |
use Getopt::Long; | |
use Pod::Usage; | |
# global variables | |
my $help = 0; | |
my $man = 0; |
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
#! /usr/bin/perl | |
use strict; | |
use warnings; | |
&main; exit; | |
sub main { | |
if (!$ARGV[0]) { | |
print "Usage: $0 <script name>\n"; |
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
/* | |
* progress_listener.js | |
* Kosei Moriyama <[email protected]> | |
* | |
* Sample code for Firefox Extension. | |
* Do something when uri is changed using progress listener. | |
*/ | |
window.addEventListener('load', function() { myExtension.init(); }, false); | |
window.addEventListener("unload", function() { myExtension.uninit(); }, false); |
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
/* | |
* Kosei Moriyama <[email protected]> | |
* | |
* Sample code for Firefox Extension. | |
* Get installed extension data using extensionsManager. | |
* List of attributes of extension data (returned value of getItemList()): | |
* http://www.oxymoronical.com/experiments/apidocs/interface/nsIUpdateItem | |
*/ | |
var extensionsManager = Components.classes["@mozilla.org/extensions/manager;1"] |
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
/* | |
* Kosei Moriyama <[email protected]> | |
* | |
* Sample code for Firefox Extensions. | |
* Enable auto complete for certain form from history of inputs. | |
*/ | |
// Write like this in xul firstly. | |
// Set "id" and "autocompletesearchparam" attribute for your own. | |
// <textbox id="my-form" type="autocomplete" autocompletesearch="form-history" autocompletesearchparam="my-form-history"/> |
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
var ul = document.querySelectorAll("ul"); | |
var i; | |
var out = ""; | |
for (i=2; i<ul.length; i++) { | |
var li = Array.slice.call(ul[i].querySelectorAll("li")); | |
li.map(function(x) { | |
var c = x.childNodes; | |
if (c.length === 1) { | |
var del = c[0].nodeValue.indexOf(":"); |
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
# /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import re | |
from xml.dom.minidom import parse | |
def markdown_nize(html): | |
ret = '' | |
html = html.encode('utf-8') |
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
import sys | |
for line in sys.stdin: | |
tmp = line.strip().split(',') | |
print "insert into eip_t_todo (user_id, todo_name, category_id, priority, state, note, start_date, end_date, public_flag, addon_schedule_flg) values (10, {0}, 9, 3, 0, {1}, '2011-05-06', '9999-12-31', 'T', 'T');".format(tmp[0], tmp[1]) |
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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
''' | |
clgrep.py | |
grep ChangeLog memo. | |
forked from clgrep on Ruby (http://0xcc.net/unimag/1/) | |
Kosei Moriyama <[email protected]> |