Skip to content

Instantly share code, notes, and snippets.

View varmil's full-sized avatar
🏠
Working from home

Akihiro Yamamoto varmil

🏠
Working from home
View GitHub Profile
@varmil
varmil / LocalEmulatorAuth.ts
Last active November 14, 2021 09:14
the singleton class when run e2e testing with Firebase Authentication x Local Emulator Suite
import * as admin from 'firebase-admin'
import axios from 'axios'
const PROJECT_ID = 'your-project-id'
type FirebaseAuthAPIUser = {
idToken: string // 新しく作成されたユーザーのFirebaseAuthIDトークン。
email: string // 新しく作成されたユーザーの電子メール。
refreshToken: string // 新しく作成されたユーザーのFirebaseAuth更新トークン。
expiresIn: string // IDトークンの有効期限が切れる秒数。

ターニャ D+520 試練2

1 2 3 4 5 6
戦闘 悲鳴 共墓
三頭 加速 双頭
加速 加速 双頭
機能 戦闘 共墓
  • 序盤に琥珀石GET
///////////////////
/// PARSER CORE ///
///////////////////
// There is an annotated configuration object in the GRAMMAR section below
function Parser(config) {
var prio = this.priorities = config.priorities;
prio["boundary:$"] = [-1, -1];
this.re = config.re;
this.toktypes = config.toktypes;
@varmil
varmil / file0.txt
Last active January 20, 2017 13:53
docker-nginx を vagrant(centos 7)上で動かしたが、mac(ローカルマシン)から接続できず苦戦した話 ref: http://qiita.com/varmil/items/3a93709d935ed2d710d5
nginx:
image: nginx:1.10.2-alpine
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/mynginx.cnf:/etc/nginx/conf.d/mysite.template
ports:
- "8080:80"
environment:
- NGINX_HOST=127.0.0.1
- NGINX_PORT=80
@varmil
varmil / Vagrantfile
Last active January 10, 2017 03:39
vagrant + centos 7 でvagrant upが止まる、ネットワーク接続できない問題への対処 ref: http://qiita.com/varmil/items/4da286337c9cb9214301
config.vm.provision "shell", run: "always", inline: "systemctl restart network.service"
@varmil
varmil / file0.sql
Created May 30, 2016 03:52
【MySQL】基礎。InnoDBのbuffer poolはページ単位(列ではなく)でキャッシュする ref: http://qiita.com/varmil/items/52684b32fad16b653dba
SELECT Name,Dept FROM Employees WHERE Id = 3;

MySQL Sharding

8台の物理サーバに1つずつMySQLインスタンス。それぞれのインスタンスは master - master replicated onto a backup host in case the primary fails

use master, not slave...

Our production servers only read/write to the master. I recommend you do the same. It simplifies everything and avoids lagged replication bugs.

各MySQLインスタンスは512個位ずつdatabaseを持つ。

@varmil
varmil / .bash_profile
Last active August 29, 2015 14:24
node0.12.7 で casperjs@1.1.0-beta3 をnpmにて正しくインストールする方法(Mac + nodebrew) ref: http://qiita.com/varmil/items/e0b97e6879945ede596a
PHANTOMJS_EXECUTABLE=$HOME/.nodebrew/current/lib/node_modules/casperjs/node_modules/phantomjs/bin/phantomjs
@varmil
varmil / file0.cs
Last active November 14, 2018 06:38
古典的オブザーバパターンをいまさら基礎からみる【デザインパターン】 ref: https://qiita.com/varmil/items/8cd8fe9da510e31d940a
class Model
{
// データ変更時に呼ばれる
void DataChanged() {
// 変更後のデータを取得
var newData = this.GetData();
// ModelからViewを直接変更(MVC原則に違反しています!)
FooView.Update(newData);
}
}
@varmil
varmil / bad.js
Last active August 29, 2015 14:17
200万件のCSVをparseしつつMongoDBに素早く突っ込むにはBulk()を使う(Nodeでやってみた) ref: http://qiita.com/varmil/items/be53a562393dcfb8867e
var fs = require('fs');
var MongoClient = require('mongodb').MongoClient;
var CSV = require('comma-separated-values');
var NAME_MONGO_DB = 'eijiro';
var NAME_MONGO_COLLECTION = 'words';
var url = 'mongodb://localhost:27017/' + NAME_MONGO_DB;
var inputCsv = process.argv[2];
var text = fs.readFileSync(inputCsv, 'utf-8');