Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Wanna work abroad

Yuki Hirai yukihirai0505

:octocat:
Wanna work abroad
View GitHub Profile
@yukihirai0505
yukihirai0505 / 01_coin-regular-investment.md
Last active Jun 22, 2018
bitbankのAPIを使用してリップルとモナコイン を成行買いするためのGoogle Apps Script
View 01_coin-regular-investment.md

Get Started

スプレッドシートを用意して シートの名前を bitbank に設定

bitbankのAPIキーやシークレット、積立したい金額を入力

dglxcxuvaaeipji

@yukihirai0505
yukihirai0505 / google_suggest.sh
Last active Sep 3, 2019
Google検索サジェスト
View google_suggest.sh
curl "https://www.google.co.jp/complete/search?hl=ja&output=toolbar&ie=utf-8&oe=utf-8&client=firefox&q=旦那"
@yukihirai0505
yukihirai0505 / docker-compose.yml
Created May 16, 2018
docker-compose.ymlでwordpressの環境構築
View docker-compose.yml
version: '2'
services:
db:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: {root-pass}
MYSQL_DATABASE: {db-name}
MYSQL_USER: {user-name}
MYSQL_PASSWORD: {user-password}
@yukihirai0505
yukihirai0505 / v1_crypto_sheet.gs
Last active Jan 26, 2018
KuCoin,Cryptopia,Binance,CoinExchangeで購入してる仮想通貨の情報を取得するプログラム with Zaifビットコイン価格
View v1_crypto_sheet.gs
var BK = SpreadsheetApp.getActiveSpreadsheet(),
SHEET = BK.getSheetByName('portfolio'),
QUERY_STRING = Math.random(),
BTC_SYMBOL = 'BTC';
function onOpen() {
function showMenu() {
var menu = [
{name: "Get Crypto Currency Data", functionName: "setData"}
];
@yukihirai0505
yukihirai0505 / OutputTwitterFollower.md
Created Jan 23, 2018
Twitterで特定のユーザーのフォロワー名を全部取得する
View OutputTwitterFollower.md
  1. フォロワーIDを取得する => 5,000*15で15分で75,000フォロワー取得可能
  2. IDからユーザーを検索 => 100*900で15分で90,000分のユーザー情報取得可能
@yukihirai0505
yukihirai0505 / getBinanceCryptoCurrencyData.gs
Last active Jan 12, 2018
Binance(バイナンス)の銘柄情報取得プログラム
View getBinanceCryptoCurrencyData.gs
var BK = SpreadsheetApp.getActiveSpreadsheet(),
SHEET = BK.getSheetByName('portfolio');
function onOpen() {
function showMenu() {
var menu = [
{name: "Get Crypto Currency Data", functionName: "setData"}
];
BK.addMenu("Custom Management", menu);
}
@yukihirai0505
yukihirai0505 / getZaifAndBinanceData.gs
Last active Feb 9, 2018
Get crypto currency data from zaif and binance
View getZaifAndBinanceData.gs
var BK = SpreadsheetApp.getActiveSpreadsheet(),
SHEET = BK.getSheetByName('portfolio'),
BTC_SYMBOL = 'BTC';
function onOpen() {
function showMenu() {
var menu = [
{name: "Get Crypto Currency Data", functionName: "setData"}
];
BK.addMenu("Custom Management", menu);
View getCryptoCurrencyData.gs
var BK = SpreadsheetApp.getActiveSpreadsheet(),
SHEET = BK.getSheetByName('portfolio');
function onOpen() {
function showMenu() {
var menu = [
{name: "Get Crypto Currency Data", functionName: "setData"}
];
BK.addMenu("Custom Management", menu);
}
@yukihirai0505
yukihirai0505 / popular_post_list.sql
Last active Dec 22, 2017
Wordpress popular post list
View popular_post_list.sql
# 全投稿view数順
SELECT
p.post_title,
pm.meta_value,
p.guid
FROM wp_posts p
INNER JOIN wp_postmeta pm
ON p.id = pm.post_id
AND pm.meta_key = "post_views_count"
View mapToken.scala
// dtoSeqを5000で分割して、それぞれに別々のトークンを付与する
protected def mapToken[T](dtoSeq: Seq[InstagramDto[T]], tokens: Seq[String]): Seq[InstagramDto[T]] = {
dtoSeq.grouped(5000).toSeq.zipWithIndex.flatMap {
case (d, i) => d.map { s =>
def getIndex(index: Int): Int = {
if (index < tokens.length) index
else getIndex(index - tokens.length)
}