Skip to content

Instantly share code, notes, and snippets.

View akiyoshi83's full-sized avatar

akiyoshi akiyoshi83

  • Individual
  • Tokyo
View GitHub Profile
@akiyoshi83
akiyoshi83 / Dockerfile
Created December 13, 2021 20:36
Docker image for conversion of time zones
# USAGE
# docker build -t tzconv .
# docker run tzconv "2022-01-01 00:00:00 JST"
#
# OPTIONAL: set alias to your shell configuration
# e.g. alias tzconv="docker run tzconv"
FROM ubuntu
RUN apt-get update && apt-get install tzdata
@akiyoshi83
akiyoshi83 / tzconv
Created July 22, 2021 13:22
Show time by multiple timezone.
# Example:
# $ tzconv
# 2021-07-22 13:19:25 UTC
# 2021-07-22 22:19:25 JST
# 2021-07-22 06:19:25 PDT
# 2021-07-22 14:19:25 BST
#
# $ tzconv "2021-01-01 00:00 JST"
# 2020-12-31 15:00:00 UTC
# 2021-01-01 00:00:00 JST
@akiyoshi83
akiyoshi83 / docker-compose.yml
Last active May 20, 2020 19:09
Run jupyter lab by docker-compose
# Start container:
# docker-compose up -d
#
# Open http://localhost:8888/ in browser and run the samples
#
# Stop the container:
# docker-compose stop
#
# Stop and remove container, network, etc.:
# docker-compose down
@akiyoshi83
akiyoshi83 / rails-docker-compose-init.sh
Last active December 17, 2019 23:09
Initialize rails dev env using docker-compose
# USAGE
# ------
#
# Please ensure there is that global_bundle volume before execute this script.
#
# ```
# docker volume create global_bundle --driver local
# bash rails-docker-compose-init.sh
# docker-compose run web rails new --database postgresql --skip-bundle --force .
# # edit your Gemfile and config/database.yml (host, username, password)
@akiyoshi83
akiyoshi83 / export_sender_by_label.py
Last active February 19, 2020 20:37
Export senders from Gmail by label
"""
Find and export senders from gmail by label to senders.csv
USAGE: python export_sender_by_label.py LABEL_NAME
"""
from __future__ import print_function
from apiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
import sys
import csv
@akiyoshi83
akiyoshi83 / chromedp_example.go
Last active March 14, 2023 21:21
Scraping by go using chromedp
package main
import (
"context"
"fmt"
"io/ioutil"
"log"
"time"
"github.com/chromedp/cdproto/cdp"
package main
import (
"fmt"
"log"
"os"
"os/signal"
"syscall"
"github.com/go-fsnotify/fsnotify"
@akiyoshi83
akiyoshi83 / chrome_example.rb
Created December 30, 2017 13:57
Selenium by ruby
require 'bundler/setup'
require 'io/console'
require 'utils'
DRIVER_PATH = File.absolute_path case Utils::os
when :osx
'./driver/chromedriver_mac64'
when :windows
'./driver/chromedriver_win64.exe'
when :linux
class CloudFormation {
createStack(version: AWSTemplateFormatVersion): CloudFormationStack {
return new CloudFormationStack(version);
}
}
class AWSTemplateFormatVersion {
private version: string;
private constructor(version: string) {
this.version = version;
@akiyoshi83
akiyoshi83 / get-awsdocs.sh
Last active April 10, 2016 12:44
Clone AWS documents by wget
#!/bin/bash
# ./get-awsdocs.sh -o ./wget.log -P ./awsdocs/
wget \
-rpkH \
-l 0 \
-np \
-N \
--reject=.pdf \
--reject-regex=feedback\(yes\|no\) \
--exclude-domains=alas.aws.amazon.com,amp.aws.amazon.com,blogs.aws.amazon.com,console.aws.amazon.com,forums.aws.amazon.com,portal.aws.amazon.com,signin.aws.amazon.com,status.aws.amazon.com \