Skip to content

Instantly share code, notes, and snippets.

View shinmiy's full-sized avatar
🎷
〜♪

shinmiy shinmiy

🎷
〜♪
  • Tokyo, Japan
View GitHub Profile
@shinmiy
shinmiy / introrx.md
Created December 8, 2015 01:22 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@shinmiy
shinmiy / tldr.md
Last active June 19, 2017 02:15
SMMRYが便利

SMMRY

javascript:(function(){location.href='http://smmry.com/'+window.location.href+'#&SM_LENGTH=7';})()

SMMRY + Google Translate

javascript:(function(){location.href='https://translate.google.com/translate?sl=auto&tl=ja&u=http://smmry.com/'+window.location.href+'#&SM_LENGTH=7';})()
@shinmiy
shinmiy / gist:b1e02a2317f4589bbe69
Last active August 4, 2017 05:53 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

Unityのドキュメント、検索で引っかかるやつが古かったりするので、最新の英語版に変換するブックマークレット作った。

↓のリンクをブックマークバーにドラッグ・アンド・ドロップして、

Unityドキュメント変換

右クリック→アドレスを編集でwww.google.co.jpを↓に置き換える

javascript:(function(u){if (u.match(/docs\.unity3d\.com\/(jp\/)*[0-9]+\//g)) location.href=u.replace(/(jp\/)*[0-9]+\//g,"");})(document.URL)
@shinmiy
shinmiy / calendar_generator.rb
Last active September 4, 2018 22:45
日記のテンプレジェネレーター
#!/usr/bin/ruby
require "date"
class Date
def this_sunday # 次の日曜日 or 日曜日なら当日
self + (7 - self.wday) % 7
end
def prev_monday # 直前の月曜日 or 月曜日なら当日
@shinmiy
shinmiy / convert_to_instagram.sh
Last active October 13, 2018 16:02
Quick hack that adds a transparent border to convert images to 5:4 or 4:5 in order to post full size images to Instagram
# Quick hack that adds a white border to convert images to 5:4 or 4:5 in order to post full size images to Instagram
# インスタにフルサイズの画像を投稿するために5:4もしくは4:5に画像を変換する(白い枠をつける)
filename="filename.jpg"
# Vertical Images / 縦画像
convert $filename -virtual-pixel white -set option:distort:viewport "%[fx:h/5*4]x%[fx:h]-%[fx:(h/5*4-w)/2]-0" -filter point -distort SRT 0 +repage convert $1 -virtual-pixel white -set option:distort:viewport "%[fx:h/5*4]x%[fx:h]-%[fx:(h/5*4-w)/2]-0" -filter point -distort SRT 0 +repage "${filename%.*}_resized.${filename##*.}"
# Horizontal Images / 横画像
convert $filename -virtual-pixel white -set option:distort:viewport "%[fx:w]x%[fx:w/5*4]-0-%[fx:(w/5*4-h)/2]" -filter point -distort SRT 0 +repage convert $1 -virtual-pixel white -set option:distort:viewport "%[fx:h/5*4]x%[fx:h]-%[fx:(h/5*4-w)/2]-0" -filter point -distort SRT 0 +repage "${filename%.*}_resized.${filename##*.}"
@shinmiy
shinmiy / olkb.json
Created September 4, 2019 15:09
OLKB-like Modifers for Karabiner Elements
{
"title": "OLKB on tenkeyless",
"rules": [
{
"description": "Lower/Raise Modifiers",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "lang2",
#!/bin/bash
while :;do
filename=`date +"%Y-%m-%d_%H-%M-%S"`
screencapture -Cx screenshot_${filename}.jpg
convert screenshot_${filename}.jpg -resize 50% screenshot_${filename}_small.jpg
# imagesnap -w 2 face_${filename}.jpg
# convert face_${filename}.jpg -resize 25% face_${filename}_small.jpg
@shinmiy
shinmiy / nativefier_essensitals_generator.sh
Last active March 20, 2020 04:13
Generates essential apps via nativefier
#!/bin/bash
nativefier -n Gmail -f --single-instance --internal-urls "gmail|google" "https://mail.google.com"
nativefier -n Calendar -f --single-instance --internal-urls "calendar|google" "https://calendar.google.com"
nativefier -n YouTubeAlwaysOnTop -f --single-instance --always-on-top --internal-urls "youtube|google" "https://www.youtube.com"
nativefier -n YouTube -f --single-instance --internal-urls "youtube|google" "https://www.youtube.com"
nativefier -n musicForProgramming --single-instance --internal-urls "musicforprogramming\.net" "https://musicforprogramming.net/"
nativefier -n TweetDeck --single-instance --internal-urls "tweetdeck\.twitter\.com" "https://tweetdeck.twitter.com/"
nativefier -n TimeTree -f --single-instance --internal-urls "timetreeapp.com" "https://timetreeapp.com"
@shinmiy
shinmiy / on-air.sh
Last active May 14, 2020 15:05
ZoomとかGoogle Meetで会議中かを判定して隣の部屋のランプをつけるやつ。Bitbarで定期実行など。
#!/bin/bash
export PATH=$PATH:/usr/local/bin
function toggle_light() {
host='192.168.xxx.xxx'
if [ $1 -eq 0 ];then
/usr/local/bin/tplink-smarthome-api setPowerState $host false
else
/usr/local/bin/tplink-smarthome-api setPowerState $host true
fi