Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@imaizume
imaizume / ping-logging.sh
Created February 3, 2016 12:29
Concurrently ping given IP and log the results with time stamp.
#!/bin/bash
cd `dirname $0`
if [ $# -le 0 ]; then
echo "Please set more than 1 arguments" 1>&2
exit 1
fi
args=("$@")
argn=$#
@imaizume
imaizume / tonton-count.rb
Last active July 26, 2016 08:02
トントンから日時ごとに集まれる人の数を表示する
require 'nokogiri'
require 'open-uri'
require 'pp'
require 'matrix'
unless ARGV.length > 0
puts "Please pass tonton's URL to the argument."
exit
end
@imaizume
imaizume / runcommand.init.bat
Last active August 6, 2016 05:28
ホームディレクトリ以下に好きな名前でショートカットを配置するディレクトリを作りそこへのパスを持つ環境変数を設定する。その後手動でこれらの環境変数をPathに含めると「プログラム名を指定して実行」からショートカットが起動できる。
@echo off
set BASE=C:%HOMEPATH%\runcommand
setx SHORTCUT_HOME %BASE%\shortcuts
setx URL_HOME %BASE%\urls
setx DIR_HOME %BASE%\dirs
mkdir %BASE%
mkdir %SHORTCUTS_HOME%
mkdir %URL_HOME%
@imaizume
imaizume / local_convert.rb
Created January 13, 2017 09:12
tex-boxでゲストからホストにtexディレクトリをrsyncして指定したtexファイルをPDF変換し返却するRubyスクリプト
#! /bin/sh
exec ruby -S -x "$0" "$@"
#! ruby
require 'fileutils'
src_path = ARGV[0]
unless File.exist?(src_path)
puts 'Specified file path does not exist.'
exit(0)
@imaizume
imaizume / replace-commas-and-periods.rb
Created February 5, 2017 06:18
.git/hooks以下に"pre-commit"で置いておくとcommit時に「、」と「。」を「,」と「.」に変換してくれるスクリプト
#!/usr/bin/env ruby
# Tex files to be committed
tex_files_changed = `git diff --cached --name-only HEAD | grep -E '.*\.tex$'`
# Replace into commas and periods
THE_ENCODING = 'utf-8'
tex_files_changed.each_line do |texname|
puts "Replace into commas and periods in #{texname}"
texname.chomp!
@imaizume
imaizume / izm.svg
Created May 2, 2017 05:32
source of my icon
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@imaizume
imaizume / post-checkout
Last active June 6, 2017 02:35
新規にブランチを作成したら自動で空コミットを作成するgit hook
#!/usr/bin/env ruby
before, after, switch = ARGV
exit 0 unless before == after
exit 0 unless switch.to_i == 1
branch = `git rev-parse --abbrev-ref HEAD`
msg = "Created new branch #{branch}"
system(%(git commit --allow-empty -m "#{msg}"))
#!/bin/bash
IFS_bak=$IFS
IFS=$'\n'
s3_movies=($(aws s3 ls --profile=s3-admin s3://private.imaizu.me/movies/ | awk '{print $4 " " $5}'))
local_movies=($(ls -1 *.mp4))
archive_dir=${HOME}/Desktop/archived_movies/
for s in "${s3_movies[@]}"; do
@imaizume
imaizume / matome.md
Last active January 9, 2019 10:13 — forked from atsushisakai-gh/matome.md
井戸端iOS飯で過去に見た動画まとめ

井戸端iOS

とは?

井戸端iOSとは、昼休み1時間+MTG分の30分の計1時間30分を利用して、 NBFオフィスのコラボのプロジェクターとスクリーンを利用して、 最新のスマホアプリ開発技術に関する動画を見ながらご飯を食べて、 交流する場です。

ぜひお気軽にご参加ください。

@imaizume
imaizume / README.md
Last active September 2, 2019 07:52
Simple ruby script to generate screen shot preview as markdown files from snapshot testing result.

README

For iOSSnapshotTestCase (screenshots-preview-generator-for-ios-snapshot-testcase.rb)

This scripts works under the condition that your test case

  • includes .OS, .screenSize to fileNameOptions at least.
  • specifies folderName which will be the markdown file name.
  • specifies identifier for each FBSnapshotVerifyView call which will be the header of columns.