Skip to content

Instantly share code, notes, and snippets.

// jrunscript/Rhino
/**
* @param writer java.io.Writer
*/
function FileWriter(writer){
this.writer = writer;
}
FileWriter.prototype.close = function(){
this.writer.close();
@sonota88
sonota88 / libo_calc.bat
Last active August 29, 2015 14:04
LibreOffice Calc Sample
@echo off
set JJS=C:\path\to\java\bin\jrunscript.exe
set LIBO_DIR=C:\Program Files (x86)\LibreOffice 4
set CLASSPATH=%LIBO_DIR%\program\classes\unoil.jar
set CLASSPATH=%CLASSPATH%;%LIBO_DIR%\URE\java\juh.jar
set CLASSPATH=%CLASSPATH%;%LIBO_DIR%\URE\java\jurt.jar
set CLASSPATH=%CLASSPATH%;%LIBO_DIR%\URE\java\ridl.jar
rem echo %CLASSPATH%
var MyJSON = {};
function isArray(arg){
return Object.prototype.toString.call(arg) === '[object Array]';
}
function escapeStr(s){
return '"' + s
.replace(/\\/g, "\\\\")
.replace(/\t/g, "\\t")
@sonota88
sonota88 / readme.md
Last active August 29, 2015 14:05
選択範囲を外部プログラムで加工するサクラエディタ用JScriptマクロの雛形
/*
The MIT License
Copyright (c) 2009 sonota <yosiot8753@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@sonota88
sonota88 / extract.rb
Created February 13, 2011 12:57
yapra/plugins/feed/extract.rb / Extract feed using user defined XPath or hAtom.
# -*- coding: utf-8 -*-
require 'yapra/plugin/mechanize_base'
module Yapra::Plugin::Feed
# description:
#
# Extract as feed from a web page using hAtom or user defined XPath.
#
@sonota88
sonota88 / custom_plus.rb
Created February 20, 2011 21:22
yapra/plugins/feed/custom_plus.rb / Extract feed using user defined XPath or hAtom or LDRize siteinfo.
# -*- coding: utf-8 -*-
#require 'pp'
require 'open-uri'
require 'time'
require 'rss'
require 'rubygems'
require 'yapra/plugin/mechanize_base'
module LDRize
@sonota88
sonota88 / count-japanese-chars.el
Created February 27, 2011 14:54
Emacs Lisp to count Japanese zenkaku/hankaku character mixed string.
(defun asciip (char-code)
(and (<= 32 char-code)
(<= char-code 126)))
;; (asciip ?a) ; => t
;; (asciip ?あ) ; => nil
;; see also: japan-util.el
;; char-code のリスト
@sonota88
sonota88 / check-engineer-blog-hatom.rb
Created March 7, 2011 14:42
IT・ウェブ系企業エンジニアブログのhAtom対応状況を調べてみた http://d.hatena.ne.jp/sonota88/20110307/1299510096
# -*- coding: utf-8 -*-
require "pp"
require "rubygems"
require "mofo"
list_src = <<EOB
株式会社インフィニットループ技術ブログ - 札幌のソフト開発会社インフィニットループのスタッフが送る技術ブログ
http://www.infiniteloop.co.jp/blog/
BPS株式会社 開発ブログ Beyond Perspective Solutions LTD.
@sonota88
sonota88 / twitter-dt.user.js
Created March 21, 2011 01:41
Twitter から sinsai.info へのレポート用。日付をフォーマットして表示+コピペしやすいように
// ==UserScript==
// @name twitter-dt
// @namespace anbt
// @include http://twitter.com/*/status/*
// @include http://twitter.com/*/statuses/*
// @include https://twitter.com/*/status/*
// @include https://twitter.com/*/statuses/*
// ==/UserScript==
/*