Skip to content

Instantly share code, notes, and snippets.

Haruo Kinoshita haruo31

Block or report user

Report or block haruo31

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@haruo31
haruo31 / Dockerfile
Created Nov 25, 2019
docker bootstrap for lsp perl-languageserver (wip)
View Dockerfile
FROM perl:5.10
ENV PERL_MM_USE_DEFAULT 1
ENV PERL_EXTUTILS_AUTOINSTALL --defaultdeps
RUN perl -MCPAN -e "install Perl::LanguageServer"
WORKDIR /
@haruo31
haruo31 / sample.sh
Created Oct 6, 2019
Find CD information and store into *.cdr image using diskutil information. (extra command xidel is required to work.)
View sample.sh
diskutil list -plist |
xidel --data=- --extract "//*/string[.='CD_partition_scheme']/../*" |
awk 'NR % 2 == 1 { printf "%s\t", $0; } NR % 2 == 0 { print $0; }' |
IFS=$'\t' while read key value; do
case "$key" in
"DeviceIdentifier")
DEVICE=/dev/${value}
;;
"VolumeName")
VOLNAME="${value}"
@haruo31
haruo31 / result.md
Created Apr 24, 2019
output of jshell@OpenJDK-12
View result.md
$ jshell
|  Welcome to JShell -- Version 12
|  For an introduction type: /help intro

jshell> /set feedback verbose
|  Feedback mode: verbose

jshell> var v = "AAA"
@haruo31
haruo31 / java-bytearray.md
Created Mar 26, 2019
The script converts 8bit hex string into integer list for java bytes array
View java-bytearray.md

The script converts 8bit hex string into integer list for java bytes array

e.g.

  • 0x94, 0x0a, 0xc0 -> -0x6c, 0x0a, -0x40
  • 94 0A C0 -> -0x6c, 0x0a, -0x40

this script uses Array.prototype.map().

input

@haruo31
haruo31 / script.js
Created Mar 24, 2019
Greesemonkey script generates json list from aliexpress order list.
View script.js
// ==UserScript==
// @name AliExpress order collector
// @version 1
// @include https://trade.aliexpress.com/orderList.htm*
// ==/UserScript==
function run() {
var elem = document.querySelector('.me-menu-body').appendChild(document.createElement('textarea'));
elem.value = (JSON.stringify(
Array.prototype.slice.call(document.querySelectorAll('.order-item-wraper'))
@haruo31
haruo31 / BreakUpCells.bas
Last active Dec 11, 2018
The Excel VBA script un-merge cells and copy contents to them. It runs on current worksheet. - Excelの開いているシートにある全ての結合セルを分解し、それぞれに内容をコピーするVBA
View BreakUpCells.bas
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 Apr 20, 2018 — forked from mapiondev/ProcessBroker.java
[java] 外部コマンド実行するクラス(スレッド安全版?)
View ProcessBroker.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 Oct 31, 2017
batch script for generating and optimizing iOS icon image based https://github.com/smallmuou/ios-icon-generator
View generate_ios_icons.sh
#!/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 Jul 27, 2018
放送大学の単位認定試験 過去問PDFを Mac(もしくはLinux, 要はghostscriptで)でまとめる手順
View readme.md

目的

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

準備

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

@haruo31
haruo31 / shell command
Created Dec 14, 2016
Sum size of files which are found in find command.
View shell command
$ find . -name '*.m2ts' | xargs stat -c%s | paste -s -d+ | bc
You can’t perform that action at this time.