Skip to content

Instantly share code, notes, and snippets.

@ryosms
ryosms / .git_alias
Last active November 27, 2023 02:13
# how to use
# 1. download this file (e.g. ~/.git_alias)
# 2. include this file from .gitconfig
# [include]
# path = ~/.git_alias
[alias]
# Delete all merged local branch
cleanbranch = !"git switch develop && git pull --prune && git branch --merged | egrep -v '(accept|develop|production|master|main)' | xargs -n1 git branch -d"
cb = cleanbranch
@ryosms
ryosms / PhoneStateTestActivity.java
Created June 27, 2012 01:14
電波強度取得
package jp.sumasu.test;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.telephony.PhoneStateListener;
import android.telephony.SignalStrength;
import android.telephony.TelephonyManager;
import android.widget.TextView;
@ryosms
ryosms / googleinput_config.txt
Created October 15, 2012 07:01
ATOK風のキーバインドをベースに、「変換」キーで日本語入力をON、「無変換」キーで日本語入力をOFFにする(Mac風)の調整を入れた、ぐぐる日本語入力さんのconfigファイル
status key command
Conversion Backspace Cancel
Conversion Ctrl a SegmentFocusFirst
Conversion Ctrl Backspace Cancel
Conversion Ctrl d SegmentFocusRight
Conversion Ctrl Down CommitOnlyFirstSegment
Conversion Ctrl e ConvertPrev
Conversion Ctrl Enter Commit
Conversion Ctrl f SegmentFocusLast
Conversion Ctrl g Cancel
@ryosms
ryosms / awesome-batch.ps1
Last active December 20, 2019 06:53
Windowsのバッチ処理の実行結果をmkr wrapとmkr annotationsで確認する
param(
[int]$ExitCode = 0,
[int]$WaitSeconds = 60
)
Write-Output("Start awesome-batch (WaitSeconds: {0})" -f $WaitSeconds)
# wait 1 minute
Start-Sleep -Seconds $WaitSeconds
@ryosms
ryosms / congratulations.py
Last active February 8, 2019 08:40
Create 'CONGRATULATIONS' image from [pixela](https://pixe.la) using [pixela2img](https://github.com/ryosms/pixela2img).
from pixela2img import Pixela2Img
from PIL import Image
converter = Pixela2Img()
congratul = converter.convert('ryosms', 'congratulations', date='20180210')
ations = converter.convert('ryosms', 'congratulations', date='20190216')
width = congratul.width + ations.width + 1
height = congratul.height
@ryosms
ryosms / RakutenGsonConverter.java
Created August 13, 2013 08:38
楽天の凶悪なJsonをAndroidAnnotationのRest APIで無理やりなんとかするアレ
package jp.sumasu.rakutenapi;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.GsonHttpMessageConverter;
/**
* @author ryosms - ryo.sms at gmail.com
*/
public class RakutenGsonConverter extends GsonHttpMessageConverter {
@ryosms
ryosms / Android.gitignore
Last active December 15, 2015 17:39
俺々.gitignore for Android
#
# .gitignore template for Android development
#
# This template is combined the following files in github/gitignore
# https://github.com/github/gitignore
#
# 1. Android.gitignore
# 2. Global/Eclipse.gitignore
# 3. Global/OSX.gitignore
# 4. Global/Windows.gitignore
・好きな言語は?
・好きなメソッドは?
・好きなアニメは?
・好きなガンダムシリーズは?
・githubアカウントは?
・英語しゃべれる?
・最近気になるテクノロジーは?
・最近行った勉強会は?
・最近登壇した勉強会は?
・iPhone落とした事ある?
@ryosms
ryosms / GitLab-CI2.0.md
Created January 29, 2013 07:54
さくらのVPSにUbuntu12.04を突っ込んでGitLab 4.1を入れたサーバーでGitLab CI 2.0を同居させる手順

0. 前提条件

  • サーバー:Ubunt 12.04(on さくらのVPS)
  • GitLab 4.1インストール済み
    • Ruby、mySQL、Nginxはインストール済み
  • 詳しくは GitLab4.1のインストール手順 見れ

1. GitLab-CI用ユーザーの作成

@ryosms
ryosms / GitLab4.1onUbuntu12.04.md
Last active December 11, 2015 17:09
さくらのVPSにUbuntu12.04を突っ込んでGitLab 4.1を入れる手順

1. Ubuntuのインストール

  • さくらの [VPSコントロールパネル][vps_home] から OS再インストールカスタムOSインストールへ

  • カスタムOSインストールOS選択Ubuntu 12.04 amd64 を選択

  • 注意事項を読んで 確認 ボタン → 実行 ボタン

  • VNCコンソールでインストーラーが起動するので [インストールガイド][install_guid] を参考にインストールを進める