Skip to content

Instantly share code, notes, and snippets.

View shts's full-sized avatar

Shota Saito shts

View GitHub Profile
@shts
shts / version.json
Last active March 30, 2021 16:27
version.json
{
"jp.bpsinc.alice": {
"minVersionCode": 0
},
"com.peaceteclab.alice.development": {
"minVersionName": "3.0.0"
}
}
@shts
shts / index.html
Last active July 3, 2020 02:14
透過pngの透過位置の座標を検出して矩形で囲むサンプル。
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>タイトル</title>
</head>
<body>
<div style="display: flex">
<input type="file" id="input" onchange="handleFiles(this.files)">
<button onClick="searchTranslationRect()">
describe('Matchers', () => {
describe('Compare "toBe" to "toEqual"', () => {
it('number', () => {
expect(1 + 1).toBe(2) // ok
expect(1 + 1).toEqual(2) // ok
})
it('string', () => {
expect('d' + 'b').toBe('db') // ok
expect('d' + 'b').toEqual('db') // ok
})
@shts
shts / store._actions.nuxtServerInit.js
Created May 22, 2019 10:10
nuxtServerInit が呼ばれるとき store._actions.nuxtServerInit 入っている値
// nuxt -v
// @nuxt/cli v2.6.2
store._actions.nuxtServerInit(function wrappedActionHandler (payload, cb) {
var res = handler.call(store, {
dispatch: local.dispatch,
commit: local.commit,
getters: local.getters,
state: local.state,
rootGetters: store.getters,
rootState: store.state
@shts
shts / TestFragment.kt
Last active September 27, 2018 04:47
Navigation Editor で自動生成される Fragment
package jp.shts.android.navigationsample
import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
class TestFragment : Fragment() {
@shts
shts / file0.txt
Created September 4, 2016 13:56
ポケモンGoでポケモンが近くに出現した時に発行されるブロードキャストインテントのAction名 ref: http://qiita.com/shts/items/49d1267cd439fa8baa74
com.google.android.gms.auth.trustagent.trustlet.ACTION_PERSONAL_NEARBY_ALERT
@shts
shts / file0.java
Last active July 21, 2016 08:12
Moshiを使ってPOJOからJsonObjectとJsonArrayを作成する ref: http://qiita.com/shts/items/83d261c7666ab0069326
public class User {
@Json(name = "name")
String name;
@Json(name = "age")
int age;
public User(String name, int age) {
this.name = name;
this.age = age;
}
@shts
shts / Download.java
Created June 24, 2016 08:03
RxJavaでファイルダウンロード
public class Download {
public Observable<File> download(List<String> target) {
return Observable.from(target)
.map(new Func1<String, okhttp3.Request>() {
@Override
public okhttp3.Request call(String url) {
return new Request.Builder().url(url).build();
}
})
@shts
shts / file0.rb
Last active June 1, 2016 01:27
RetrofitでJSONをPOSTする ref: http://qiita.com/shts/items/775973783966ce7b19cf
post '/user', provides: :json do
params = JSON.parse request.body.read
puts params['name']
puts params['age']
end
@shts
shts / AndroidManifest.xml
Last active January 13, 2017 03:13
gradle.propertiesに定義した値をAndroidManifest.xmlから参照する ref: http://qiita.com/shts/items/5a0ceab7334c5ad8f4f9
<meta-data
android:name="io.fabric.ApiKey"
android:value="${fabricApiKey}" />