Skip to content

Instantly share code, notes, and snippets.

View haruo31's full-sized avatar

Haruo Kinoshita haruo31

View GitHub Profile
@haruo31
haruo31 / BreakUpCells.bas
Last active December 11, 2018 16:46
The Excel VBA script un-merge cells and copy contents to them. It runs on current worksheet. - Excelの開いているシートにある全ての結合セルを分解し、それぞれに内容をコピーするVBA
Option Explicit
Sub breakUpMergedCells()
Dim curSheet As Worksheet
Dim eCell As Range, curRange As Range
Dim curAddr As String
Dim fillCell As Range
Dim filledValue As String
Set curSheet = ActiveSheet
@haruo31
haruo31 / ProcessBroker.java
Last active April 20, 2018 10:44 — forked from mapiondev/ProcessBroker.java
[java] 外部コマンド実行するクラス(スレッド安全版?)
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* ProcessBroker pb = new ProcessBroker("ps -ef | grep java".split(" "));
@haruo31
haruo31 / generate_ios_icons.sh
Created October 31, 2017 07:36
batch script for generating and optimizing iOS icon image based https://github.com/smallmuou/ios-icon-generator
#!/bin/sh
#
# Copyright 2017 haruo31 <haruo31@underthetree.jp>
# Original by 2014 Wenva <lvyexuwenfa100@126.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 furnished
@haruo31
haruo31 / readme.md
Last active July 27, 2018 04:38
放送大学の単位認定試験 過去問PDFを Mac(もしくはLinux, 要はghostscriptで)でまとめる手順

目的

過去問と回答が大学Webサービスからダウンロードできるが、学期ごとに全部バラバラで非常に管理がしにくいので、科目ごとに結合して1つのPDFとして扱えるようにする。

準備

適当なディレクトリに必要な科目の過去問と回答をダウンロードして保存する。自分は2期分を保存した。

@haruo31
haruo31 / shell command
Created December 14, 2016 16:14
Sum size of files which are found in find command.
$ find . -name '*.m2ts' | xargs stat -c%s | paste -s -d+ | bc
@haruo31
haruo31 / Sample2Main.java
Created December 6, 2016 17:32
sample 2 project
package jp.underthetree;
import java.io.*;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.StringField;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
@haruo31
haruo31 / SampleMain.java
Created December 6, 2016 17:21
sample java project
package sample;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.nio.file.Files;
import java.util.Random;
(:name howm-haruo31
:website "http://howm.sourceforge.jp/"
:description "Write fragmentarily and read collectively."
:type http-tar
:options ("xzf")
:url "http://howm.sourceforge.jp/a/howm-1.4.3.tar.gz"
:build `(("./configure" ,(concat "--with-emacs=" el-get-emacs)) ("make")))
@haruo31
haruo31 / dvdrip.sh
Created July 18, 2016 11:29
wrapper script that creates ISO file via output of dvdbackup.
#!/bin/sh
set -xe
DRIVE=/dev/sr0
TARGET=`pwd`
TMP=`mktemp -d --suffix=dvdbackup -p $TARGET`
pushd $TMP
dvdbackup -M -i $DRIVE
@haruo31
haruo31 / determine_dirname.sh
Created July 4, 2016 01:32
posix compliant determining script home directory.
#!/bin/sh
BASE=`dirname $0 | xargs -I\{\} sh -c "cd {}; pwd"`