Skip to content

Instantly share code, notes, and snippets.

View prs-watch's full-sized avatar

hctaw-srp prs-watch

View GitHub Profile
@prs-watch
prs-watch / dropbox_authorizer.py
Last active October 22, 2017 15:48
A script to create Dropbox OAuth Access Token.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import webbrowser
def create_dropbox_access_token():
"""
access dropbox.
"""
@prs-watch
prs-watch / vimiun-settings.md
Last active December 8, 2017 18:51
~fix Vimium link

Chrome Key Mappings

ページ上で以下キーを入力するとコメントの動作が得られる。

# 戻る
map h goBack
# 進む
map l goForward
  • Python Code
import requests
from bs4 import BeautifulSoup
import re


class Base:
    URL = 'https://www.baseball-reference.com/players/g/gallayo01.shtml'
    YEAR = '2011'
from pytube import YouTube
from enum import Enum
import ffmpeg
import os
import re
class Loader(Enum):
MP4 = 'mp4'
WEBM = 'webm'
@prs-watch
prs-watch / mlb_name_translator.py
Last active April 21, 2018 12:05
Translate MLB players' name into Japanese.
"""
MLB Name Translater
メジャーリーガー名をカタカナに変換します。
(例) Noah Syndergaard -> ノア・シンダーガード
"""
import pandas as pd
import pickle
class CyperUtils:
"""
Cypher QueryのUtilクラス。
CREATE文を作成する。
"""
@classmethod
def create_node_query(cls, name, label, properties, is_create = True):
"""
ノードのCREATE/MERGE文生成。
import sys
import requests
from requests_oauthlib import OAuth1 as oauth
import webbrowser
class Settings:
"""
アプリケーションを登録すると取得出来る認証情報を保持するプロパティクラス。
"""
CLIENT_ID = 'XXX'
import pandas as pd
import umap
from pyclustering.cluster import xmeans
class FGClusterExecuter:
"""
FanGraphs stats clustering class
"""
@classmethod
# meta information
FROM jupyter/minimal-notebook
LABEL maintainer="prs-watch"
# setting command
RUN pip install -U jupyterlab==0.35.6
RUN jupyter labextension install jupyterlab_voyager
RUN jupyter labextension install @jupyterlab/plotly-extension
# at directory where this Dockerfile exists..
@prs-watch
prs-watch / dockerfile-generator.py
Created August 11, 2019 11:38
Script to generate Dockerfile from container.
#!/usr/bin/env python
# coding: utf-8
import docker
import jsondiff as jd
import re
import uuid
CLIENT = docker.from_env(timeout=600)