This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script> | |
<style type="text/css"> | |
div { | |
margin-top: 3px; | |
padding: 0 10px; | |
} | |
button { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# net keiba scraper | |
# https://github.com/stockedge/netkeiba-scraper のsbt "run extract"でエラーでるのでRubyでscrapingしてDBに突っ込むとこまでスクリプトにした。 | |
# 前提として、net_keiba_htmls配下にsbt "run scrapehtml"で取得したhtmlファイルをここに全部置くこと | |
# あとは下記のディレクトリ構成にして、mysqlでDBをつくって、以下のテーブル作って、このスクリプトを実行すればよいはず | |
# ディレクトリ構成 | |
# ./ | |
# |_ Gemfile | |
# |_ net_keiba_scraper.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# 【使い方】 | |
# CLOUD_VISION_API_KEYにkeyをセットして引数に画像urlを指定してスクリプト実行する | |
# 【例】 | |
# CLOUD_VISION_API_KEY=hoge ruby cloud-vision-api-test.rb https://cloud.google.com/vision/docs/images/faulkner.jpg | |
require 'open-uri' | |
require 'base64' | |
require 'net/http' | |
require 'json' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# gem install romaji | |
require 'romaji' | |
boin = ['o','u','i','a','e','u','e','o','i','a'] | |
shiin_alphabet = ('a'..'z').to_a - ['a','i','u','e','o','q','c'] # q, cは母音と相性悪い | |
result = [] | |
boin.each do |w| | |
shiin = shiin_alphabet.to_a.sample | |
result << shiin + w |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>vue js test</title> | |
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.1.min.js"></script> | |
<style> | |
body { | |
margin: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>font maker test</title> | |
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.1.min.js"></script> | |
<style> | |
body { | |
margin: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
df = pd.read_csv('tweet_activity_metrics_example_20170314_20170412_ja.csv', header=None).loc[:, [3, 4]] | |
df = df.drop(0) | |
df[3] = pd.to_datetime(df[3]) | |
df[4] = pd.to_numeric(df[4]) | |
result = df.groupby([df[3].dt.year, df[3].dt.month, df[3].dt.day])[4].sum() | |
print(result) | |
# date sum of impressions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
function p(w: string) { | |
return new Promise(resolve => { | |
setTimeout(() => { | |
resolve(w); | |
}, 100); | |
}); | |
} |