Skip to content

Instantly share code, notes, and snippets.

@ozero
ozero / Eijirou2pgSql.php
Created February 24, 2011 06:06
Load Eijirou-XML into PostgreSQL
<?php
require_once 'Zend/Db.php';
require_once 'Zend/Config/Ini.php';
//connect db
$db=dbfactory();
// Parsing a large document with XMLReader with Expand - DOM/DOMXpath
$reader = new XMLReader();
$reader->open("EIJI-127.xml");
@ozero
ozero / addEiji2words.php
Created February 28, 2011 10:42
add desc from eijirou to words
<?php
require_once 'Zend/Db.php';
require_once 'Zend/Config/Ini.php';
//connect db
$db=dbfactory();
$fhf=fopen('./src.txt','r');
$fht=fopen('./ext.txt','w');
@ozero
ozero / gist:1002303
Created June 1, 2011 13:38
sencha touch + pinch zoom test (raw bake
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" href="resources/css-debug/sencha-touch.css" type="text/css" />
<script type="text/javascript" src="resources/sencha-touch-debug.js"></script>
<script>
//global vals
@ozero
ozero / gist:1007664
Created June 4, 2011 06:35
js: zoom the rect at mouse cursor
<html>
<head>
<script src="./jquery.js"></script>
<script>
zoomRatio=1;
loopCount=0;
mouseX=0;
mouseY=0;
@ozero
ozero / gist:1009007
Created June 5, 2011 14:43
js zoom in/out demo for sencha touch
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" href="resources/css-debug/sencha-touch.css" type="text/css" />
<script type="text/javascript" src="resources/sencha-touch-debug.js"></script>
<script>
@ozero
ozero / gist:1042343
Created June 23, 2011 10:51
Haru pdf example: bordered cell+text function
<?php
/**
* libHaru Utility Class
* @author ozero
*
*/
/*
example:
@ozero
ozero / Poitest.java
Created July 13, 2011 10:19
apache poi excel password test
package jp.ozero.poitest;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.apache.poi.hssf.record.crypto.Biff8EncryptionKey;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
@ozero
ozero / gist:1241548
Created September 26, 2011 03:21
bookmarklet: format amazon-jp url as [domain]/dp/[asin]
javascript:(function(){var i,u,a,p;u=location.href;p=u.split("/");for(i=0;i<p.length;i++){if(p[i]=="dp"||p[i]=="a"){a=p[i+1];}}if(a){location="http://www.amazon.co.jp/dp/"+a;}})();
@ozero
ozero / nlivecomxml2tsv
Created December 19, 2011 01:07
niconico live comment xml 2 tsv macro for EmEditor
document.selection.Replace("thread=\x22.*?\x22","",eeFindNext | eeFindSaveHistory | eeFindReplaceEscSeq | eeReplaceAll | eeFindReplaceRegExp);
document.selection.Replace("no=\x22.*?\x22","",eeFindNext | eeFindSaveHistory | eeFindReplaceEscSeq | eeReplaceAll | eeFindReplaceRegExp);
document.selection.Replace("vpos=\x22.*?\x22","",eeFindNext | eeFindSaveHistory | eeFindReplaceEscSeq | eeReplaceAll | eeFindReplaceRegExp);
document.selection.Replace("mail=\x22.*?\x22","",eeFindNext | eeFindSaveHistory | eeFindReplaceEscSeq | eeReplaceAll | eeFindReplaceRegExp);
document.selection.Replace("premium=\x22.*?\x22","",eeFindNext | eeFindSaveHistory | eeFindReplaceEscSeq | eeReplaceAll | eeFindReplaceRegExp);
document.selection.Replace("anonymity=\x22.*?\x22","",eeFindNext | eeFindSaveHistory | eeFindReplaceEscSeq | eeReplaceAll | eeFindReplaceRegExp);
document.selection.Replace("</chat>","",eeFindNext | eeFindSaveHistory | eeFindReplaceEscSeq | eeReplaceAll | eeFindReplaceRegExp);
document.selection.Replace("<chat","",
@ozero
ozero / app.js
Created July 13, 2012 12:42
sencha touch 2 tabpanel load external html
// You should use Ext.application, not Ext.setup
Ext.application({
name: 'SampleLoad',
requires: ['Ext.Ajax'],
launch: function () {
Ext.create("Ext.tab.Panel", {
fullscreen: true,
tabBarPosition: 'bottom',
items: [
{