Skip to content

Instantly share code, notes, and snippets.

View chezou's full-sized avatar

Aki Ariga chezou

View GitHub Profile
@chezou
chezou / ex2-3_plot_saled_prediction.ipynb
Created May 27, 2020 02:56
Ex2-3_plot_saled_prediction.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chezou
chezou / config.py
Created July 8, 2017 10:40
keyhac emacs key binding fork: https://github.com/smzht/fakeymacs
# -*- mode: python; coding: utf-8-with-signature-dos -*-
## nickname: fakeymacs
##
## Windows の操作を emacs のキーバインドで行うための設定(Keyhac版)ver.20170629_01
##
# このスクリプトは、Keyhac for Windows ver 1.75 以降で動作します。
# https://sites.google.com/site/craftware/keyhac-ja
# スクリプトですので、使いやすいようにカスタマイズしてご利用ください。
@chezou
chezou / github_vulns.py
Created December 25, 2019 09:08
GitHub SecurityVulnerabilities
import requests
class GitHubClient:
def __init__(self, apikey, session=None):
self.headers = {"Authorization": f"Bearer {apikey}"}
if not session:
self.sess = requests.Session()
else:
self.sess = session
@chezou
chezou / install-director.sh
Last active December 23, 2019 17:47
How to install Cloudera Director on Linux Subsystem on Windows 10
#!/bin/bash
# Prepare source list
cd /etc/apt/sources.list.d/
sudo curl "http://archive.cloudera.com/director/ubuntu/trusty/amd64/director/cloudera-director.list" -O
sudo curl -s "http://archive.cloudera.com/director/ubuntu/trusty/amd64/director/archive.key" | sudo apt-key add -
# Install Java
sudo apt-get update
sudo apt install oracle-j2sdk1.8
@chezou
chezou / bibriography.py
Last active December 10, 2019 16:55
Sphinxで奥付を足す方法
#
# Sphinx extension to flush bibliography forcely (for LaTeX)
#
# Original code written by tk0miya: https://gist.github.com/5886e3f5fb86bd312fd784a7a7b57884
#
# Usage:
# 1. Write `.. bibliography::` where you want to flash citation. In this case, we assume all citations are in `bib.rst`
# 2. put this file into `ext` directory
# 3. Modify conf.py. See also source/conf.py
# 4. Add `postface.rst` into your `index.rst` after citation rst
@chezou
chezou / plot_prophet_with_mpl.py
Last active December 9, 2019 08:44
Plot Facebook Prophet without model
import matplotlib as mlp
import pandas as pd
mlp.use("agg")
from matplotlib import pyplot as plt
from matplotlib.dates import (
MonthLocator,
num2date,
AutoDateLocator,
AutoDateFormatter,
@chezou
chezou / mt2md.rb
Created December 1, 2019 13:48
hatena blog 2 markdown
#!/usr/bin/env ruby
# Forked from: http://hamasyou.com/blog/2014/02/13/movable-type-to-octopress/
require 'date'
require 'mustache'
require 'stringex'
require 'cgi'
require 'reverse_markdown'
@chezou
chezou / as_msgpack_stream.R
Last active October 26, 2019 13:05
Convert R data frame to msgpack stream
devtools::install_github("crowding/msgpack-r")
library(msgpack)
x <- data.frame(a=1:3, b=4:6)
conn <- gzfile("test.msgpack.gz", open="w+b")
apply(x, 1, function(x) {writeMsg(c(x, time=as.integer(Sys.time())), conn)})
flush(conn)
close(conn)
@chezou
chezou / Gemfile
Last active May 11, 2019 16:35
Example code of ruby with Amazon Polly
source 'https://rubygems.org'
gem 'nokogiri', '~>1.6'
gem 'aws-sdk', '~> 2'