Skip to content

Instantly share code, notes, and snippets.

View akehoyayoi's full-sized avatar

Yohei Okaya akehoyayoi

View GitHub Profile
@akehoyayoi
akehoyayoi / file0.txt
Created August 25, 2016 07:57
Firebaseの設定ファイルをスキーマ毎に切り替える ref: http://qiita.com/akehoyayoi@github/items/ca1eea9605642e288664
#if PRODUCTION
let filePath = NSBundle.mainBundle().pathForResource("GoogleService-Info-pro", ofType: "plist")
#elseif STAGING
let filePath = NSBundle.mainBundle().pathForResource("GoogleService-Info-stg", ofType: "plist")
#else
let filePath = NSBundle.mainBundle().pathForResource("GoogleService-Info-dev", ofType: "plist")
#endif
let firebaseOption = FIROptions(contentsOfFile: filePath)
FIRApp.configureWithOptions(firebaseOption)
@akehoyayoi
akehoyayoi / file0.txt
Last active December 20, 2016 04:50
gvmでv1.4がinstallできない時の対処方法 ref: http://qiita.com/akehoyayoi@github/items/1046fb0290c976b7ad0d
gvm install go1.4
gvm use go1.4
gvm install go1.5
@akehoyayoi
akehoyayoi / file0.txt
Last active January 7, 2017 08:20
MySQLでのSpatialIndexの効かし方 ref: http://qiita.com/akehoyayoi@github/items/1cc7d5bf5b8a922aa5d9
mysql> desc shop;
+---------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+--------------+------+-----+---------+-------+
| name | varchar(100) | NO | | NULL | |
| address | varchar(100) | NO | | NULL | |
| lnglat | geometry | NO | MUL | NULL | |
+---------+--------------+------+-----+---------+-------+
3 rows in set (0.04 sec)
@akehoyayoi
akehoyayoi / FibTest.scala
Created March 11, 2017 02:56
Fibonacci Test
import scala.collection.mutable
/**
* Created by okayayohei on 2017/03/11.
*/
object Main {
trait Fib {
def fib(n: Long): Long
}
@akehoyayoi
akehoyayoi /  .travis.yml
Last active June 24, 2017 01:33
TravisでAndroidNDKを使っているプロジェクトをビルドする ref: http://qiita.com/akehoyayoi@github/items/570694f926fd6b7db2a4
language: objective-c
sudo: true
cache:
directories:
- $HOME/Library/Caches/Homebrew
before_install:
- brew update
- brew tap caskroom/cask
- brew install caskroom/cask/android-sdk caskroom/cask/android-ndk
- export ANDROID_HOME=/usr/local/share/android-sdk
@akehoyayoi
akehoyayoi / execMacro.vbs
Created June 24, 2017 04:06
Excel外部起動
Do While True
Dim excelApp : Set excelApp = CreateObject("Excel.Application")
' Excelを非表示にする
excelApp.Visible = False
Dim targetFile : targetFile = "[ファイル名]"
Dim targetMacro : targetMacro = "[マクロ名]"
' Excelファイルを開く
excelApp.Workbooks.Open targetFile
' マクロの実行
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/01_prepare_authorized_keys":
mode: "000777"
content: |
ARRAY=(
https://github.com/akehoyayoi.keys # アクセスできるようにしたいアカウントを列挙しておく
)
echo 'ssh-rsa 元々あったauthorized_keyを書いておく' > authorized_keys
for item in ${ARRAY[@]}; do
@akehoyayoi
akehoyayoi / file0.txt
Last active May 13, 2018 07:54
Cordovaでハイブリッドのテンプレ作るまでまとめ(Cordova+OnsenUI+vue.js) ref: https://qiita.com/akehoyayoi/items/a370071cb3747a943dd7
$ npm install -g vue-cli
$ vue init OnsenUI/vue-cordova-webpack my-project
$ cd my-project
$ npm install
$ cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID="1234567890" --variable APP_NAME="your_app_name"
$ cordova platform add ios
$ cordova platform add android
$ npm run build
$ cordova prepare
@akehoyayoi
akehoyayoi / config.json
Created July 7, 2018 02:06
Hyperledger Fabricのブロックの内容を見る ref: https://qiita.com/akehoyayoi/items/d0654880382850f7cd2b
{
"network-config": {
"org1": {
"name": "peerOrg1",
"mspid": "Org1MSP",
"peer1": {
"requests": "grpc://127.0.0.1:7051",
"events": "grpc://127.0.0.1:7053",
"server-hostname": "peer0.org1.example.com",
"tls_cacerts": "<fabric-samples-PATH>/basic-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
@akehoyayoi
akehoyayoi / Enhancer.scala
Created August 15, 2018 22:50
mixin example
class TreeControl[T] {
// これらのIFを使いたい
dataNodes: T[];
def getLevel(node: T): Int = {}
}
class NestedTreeControl[T] extends TreeControl[T] {}
class FlatTreeControl[T] extends TreeControl[T] {}
trait TreeControlEnhancer[T] {