Skip to content

Instantly share code, notes, and snippets.

View muziyoshiz's full-sized avatar

Masahiro Muzi Yoshizawa muziyoshiz

View GitHub Profile
@muziyoshiz
muziyoshiz / Word2VecModelGenerator.scala
Last active December 3, 2016 23:35
Simple Word2Vec application
package jp.muziyoshiz.word2vec
import org.apache.spark._
import org.apache.spark.rdd._
import org.apache.spark.SparkContext._
import org.apache.spark.mllib.feature.{Word2Vec, Word2VecModel}
object Word2VecModelGenerator {
def main(args: Array[String]) {
@muziyoshiz
muziyoshiz / admiral_stats_exporter.js
Last active October 14, 2016 22:37
Admiral Stats エクスポータ(JS版)
javascript:(function(){var a=new Date,e=[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2),"_",("0"+a.getHours()).slice(-2),("0"+a.getMinutes()).slice(-2),("0"+a.getSeconds()).slice(-2)].join(""),f=["Personal/basicInfo","TcBook/info","CharacterList/info"];window.location.href.match(/^https:\/\/kancolle-arcade.net\/ac\/#\/(area|list|pictureBook)/)?f.forEach(function(a){var b=new XMLHttpRequest,g=a.replace("/","_")+"_"+e+".json";b.open("GET","https://kancolle-arcade.net/ac/api/"+a);b.setRequestHeader("X-Requested-With","XMLHttpRequest");b.responseType="blob";b.onload=function(){if(200===b.status){var d=new Blob([b.response]);if(window.navigator.msSaveBlob)window.navigator.msSaveBlob(d,g);else{var d=(window.URL||window.webkitURL).createObjectURL(d),c=document.createElement("a");document.body.appendChild(c);c.download=a.replace("/","_")+"_"+e+".json";c.href=d;c.click();document.body.removeChild(c)}}else a===f[0]&&alert("Admiral Stats \u30a8\u30af\u30b9\u30dd\u30fc\u30bf(JS\u7248) v1.0.0
@muziyoshiz
muziyoshiz / gist:6ba5edd6e7cd2021e8c9bab43244581e
Created November 6, 2016 11:28
Admiral Stats API が返す JSON の素案
['Personal/basicInfo', 'Area/captureInfo', 'TcBook/info', 'EquipBook/info', 'Campaign/history', 'Campaign/info', 'Campaign/present', 'CharacterList/info', 'EquipList/info', 'Quest/info', 'Event/info']
@muziyoshiz
muziyoshiz / mix.exs
Created March 21, 2017 10:27
Sample of GraphQL Relay server on Phoenix
# mix.exs
defmodule PhoenixRelaySample.Mixfile do
use Mix.Project
def project do
[app: :phoenix_relay_sample,
version: "0.0.1",
elixir: "~> 1.2",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
@muziyoshiz
muziyoshiz / memo.txt
Last active April 25, 2017 22:59
2017-04-26 kancolle-arcade.net/ac/api の調査メモ
4/26早朝。未プレイの状態での調査結果。
丙作戦、乙作戦は公開されているが、甲作戦は公開されていない。
https://kancolle-arcade.net/ac/api/TcError/dispFlag というURLが増えている。
これは何?
https://kancolle-arcade.net/ac/api/Event/info
URL名はいままでと変わらず。キーが少し増えている。
eneMilitaryGauge2d: "base_sensuikakyuu1"
→ これはボスを表している?
@muziyoshiz
muziyoshiz / sample.apib
Created May 16, 2017 02:51
Sample of API Blueprint document
FORMAT: 1A
# Sample API
## Sample API について
Sample API は、与えられた URL にアクセスしたオーディエンスに対するレコメンド記事を返す、架空の API である。
## API 共通のエラー形式
@muziyoshiz
muziyoshiz / active_user.rb
Created September 27, 2017 15:24
Admiral Stats 1周年のユーザデータ解析
# 一時的にログ出力を無効にする
ActiveRecord::Base.logger = nil
base_time = Time.parse('2016-09-03 00:00:00 +09:00')
366.times do |i|
t = base_time + i.day
# 初回ログインしたユーザ数
num_register = Admiral.where('created_at <= ?', t.end_of_day).count
@muziyoshiz
muziyoshiz / example.md
Created December 12, 2017 22:27
Example of `--format markdown-code`

app1

177

app2

84
@muziyoshiz
muziyoshiz / main.yml
Created January 15, 2018 13:50
Example of import_tasks/include_tasks with tags
- name: Task 0
debug: msg="No tag"
- name: Task 1
debug: msg="tag1"
tags: [ tag1 ]
- name: Task 2
debug: msg="tag2"
tags: [ tag2 ]
@muziyoshiz
muziyoshiz / kekkon_yobigun.sh
Created February 14, 2018 16:13
Admiral Stats のデータから、各艦娘をLv99まで育成済みの提督数を調べる SQL
cat kekkon_yobigun.sql | mysql admiral_stats_development -uroot > kekkon_yobigun.tsv