Skip to content

Instantly share code, notes, and snippets.

View mh61503891's full-sized avatar
🍣

Masayuki Higashino mh61503891

🍣
View GitHub Profile
@mh61503891
mh61503891 / Rakefile.rb
Created February 14, 2014 18:25
LaTeX用のRakefile.rb
require 'rake'
require 'rake/clean'
TARGET = 'main'
TOOLS = {
latex:'platex -kanji=utf8',
bibtex:'pbibtex -kanji=utf8',
dvipdfmx:'dvipdfmx',
zip:'zip'
}
@mh61503891
mh61503891 / trash.prolog
Created March 9, 2014 21:39
鳥取市の鳥取地域のごみ収集ルールからCSVを生成するスクリプト
#!/opt/local/bin/swipl -q -t main -f
% 【注意:作りかけ】
% Auhtor: Masayuki Higashino
% Description: 鳥取市の鳥取地域のごみ収集ルールからCSVを生成するスクリプト。
%
% 鳥取市公式ウェブサイト:収集曜日一覧(鳥取地域)
% http://www.city.tottori.lg.jp/www/contents/1357776059978/index.html
% 週の定義
@mh61503891
mh61503891 / script.rb
Created April 30, 2014 15:46
Printing of a list of a ranking of the number of runs of commands of a history of a bash.
puts open(File.join(File.expand_path('~'), '/.bash_history'), &:readlines).map{ |c| File.basename(c.strip.split.first.to_s) }.compact.inject(Hash.new(0)){ |h, a| h.tap{ h[a] += 1} }.sort_by{ |pair| -pair.last }.map{ |pair| "#{pair.first}(#{pair.last})" }.join($/)
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.io.FilenameUtils;
@mh61503891
mh61503891 / keylogger.c
Last active August 29, 2015 14:01
A simple implementation of a keylogger for OS X.
// This program is a simple implementation of a key logger for OS X.
// This key loggger requires sudo and outputs key codes and a time stamp to standard output.
//
// build: cc keylogger.c -o keylogger -framework ApplicationServices
// usage: sudo keylogger > keylogger.log
// author: Masayuki Higashino
#include <stdio.h>
#include <time.h>
#include <ApplicationServices/ApplicationServices.h>
@mh61503891
mh61503891 / エラーログ
Last active August 29, 2015 14:02
OS Xでsmalruby-editorで実行ボタンを押したときのエラーログ
Process: ruby2.1 [53844]
Path: /opt/local/bin/ruby2.1
Identifier: ruby2.1
Version: 0
Code Type: X86-64 (Native)
Parent Process: ruby2.1 [53835]
Responsible: Terminal [405]
User ID: 501
Date/Time: 2014-06-06 21:05:32.499 +0900
@mh61503891
mh61503891 / catchball.rb
Created June 9, 2014 09:40
猫キャッチボール
require "smalruby"
ball1 = Character.new(costume: "ball6.png", x: 0, y: 0, angle: 0)
cat1 = Character.new(costume: "cat1.png", x: 0, y: 0, angle: 0)
cat2 = Character.new(costume: "cat2.png", x: 0, y: 0, angle: 0)
ball1.on(:start) do
loop do
move(35)
if 100 >= (cat1.x - x).abs && 100 >= (cat1.y - y).abs

Keybase proof

I hereby claim:

  • I am mh61503891 on github.
  • I am 61503891 (https://keybase.io/61503891) on keybase.
  • I have a public key whose fingerprint is 1E12 A8D7 F345 B577 E791 3FE7 93D0 10BE 94BA DD0E

To claim this, I am signing this object:

@mh61503891
mh61503891 / gist:4597b6108f943ce8e305
Last active August 29, 2015 14:04
A SWI-Prolog-like Json-Term converter for Prolog Cafe (Example Implementation)
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import jp.ac.kobe_u.cs.prolog.lang.DoubleTerm;
import jp.ac.kobe_u.cs.prolog.lang.IntegerTerm;
import jp.ac.kobe_u.cs.prolog.lang.ListTerm;
import jp.ac.kobe_u.cs.prolog.lang.Prolog;
@mh61503891
mh61503891 / gist:391149e363a096d40ab5
Created November 21, 2014 07:12
DRBLのインストールログ
$ cat /etc/debian_version
7.7
$ aptitude show drbl
Package: drbl
New: yes
State: installed
Automatically installed: no
Version: 2.8.25-drbl1
Priority: extra
Section: admin