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 / 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.

@shinmiy
shinmiy / bashrc
Last active May 17, 2022 08:10
git aliases.
echo "setting aliases..."
alias la='ls -alG'
##############peco################
alias cdp='cd "$( ls -1d */ | peco )"'
alias pecopy='peco|tr -d "\n"|pbcopy'
####################git####################
# source /usr/local/etc/bash_completion.d/git-prompt.sh
# source /usr/local/etc/bash_completion.d/git-completion.bash
@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';})()

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 / 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 / bitrise_status.1m.rb
Last active August 11, 2021 04:34
Bitriseの状況をBitbarで表示するスクリプト | Script to show Bitrise build statuses in Bitbar
#!/usr/bin/ruby
require 'httpclient'
require 'json'
require 'time'
# Bitrise情報 / Bitrise Info
TOKEN = 'YOUR_TOKEN_HERE'
APPS = { 'Your App Name' => 'App Slug', 'Another App Name' => 'Another App Slug' }
@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",