Skip to content

Instantly share code, notes, and snippets.

Avatar
🍚
Busy

Tomohiro Imaizumi imaizume

🍚
Busy
View GitHub Profile
@imaizume
imaizume / meet.rb
Created Jun 3, 2020
A simple Ruby script to open google meet URL from CLI. Thankfully inspied by miyagawa's perl script (https://gist.github.com/miyagawa/986e4034a09e6c822a832a4e283f331f)
View meet.rb
#!/usr/bin/env ruby
require 'date'
require 'pp'
calendar = 'your-calendar@example.com'
regex = /^https?:\/\/meet\.google.com\/[\w-]+$/i
now = DateTime.now
ends = now + Rational(1, 24) # within 1h
@imaizume
imaizume / pod_updatable_info.awk
Last active May 18, 2020
A simple awk script which parse output from "pod outdated" and format into markdown table so that you can easily have a grasp of update availability for libraries you use.
View pod_updatable_info.awk
#
# pod_updatable_info.awk
#
# Created by Tomohiro Imaizumi on 5/18/20.
# Copyright © 2017 Tomohiro Imaizumi. Licensed under MIT.
#
BEGIN {
print "| Library | Current | Podfile Latest | Global Latest | `pod update` | Podfile Specification |"
print "|:---:|:---:|:---:|:---:|:---:|:---:|"
@imaizume
imaizume / index.html
Created Feb 2, 2020
ボタンによるメニュー表示と非表示切り替えのサンプル
View index.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>sample</title>
<style>
// .hidden { display: none; } // [A] 用
.hidden2 { display: none; } // [B] 用
#content {
@imaizume
imaizume / README.md
Last active Sep 2, 2019
Simple ruby script to generate screen shot preview as markdown files from snapshot testing result.
View README.md

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.
@imaizume
imaizume / RemoteConfigManager.swift
Last active Jun 16, 2019
How to manage parameters for Firebase Remote Config in Swift easily.
View RemoteConfigManager.swift
// MARK:- definition
/// Constraint for Parameter Type Definition.
protocol ParameterProtocol {
/// Parameter name in Firebase console. e.g. "beta_test_1"
var name: String { get }
/// Default value to be set to Remote Config object.
var defaultValue: [String: NSObject] { get }
}
@imaizume
imaizume / matome.md
Last active Jan 9, 2019 — forked from radioboo/matome.md
井戸端iOS飯で過去に見た動画まとめ
View matome.md

井戸端iOS

とは?

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

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

View swap_dropbox_after_s3_upload.sh
#!/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 / post-checkout
Last active Jun 6, 2017
新規にブランチを作成したら自動で空コミットを作成するgit hook
View post-checkout
#!/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}"))
@imaizume
imaizume / izm.svg
Created May 2, 2017
source of my icon
View izm.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@imaizume
imaizume / replace-commas-and-periods.rb
Created Feb 5, 2017
.git/hooks以下に"pre-commit"で置いておくとcommit時に「、」と「。」を「,」と「.」に変換してくれるスクリプト
View replace-commas-and-periods.rb
#!/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!
You can’t perform that action at this time.