Skip to content

Instantly share code, notes, and snippets.

View shkumagai's full-sized avatar
🏠
Working from home

Shoji KUMAGAI shkumagai

🏠
Working from home
View GitHub Profile
#!/usr/bin/env python3
import base64
import secrets
def get_random_string(length: int, allowed_chars: str = (
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"0123456789"
)) -> str:
@shkumagai
shkumagai / sample.py
Last active October 20, 2021 08:34
override __init__ method
# coding:utf-8
from __future__ import print_function, unicode_literals
class Hoge(object):
_foo = None
_bar = None
_buz = None
def __init__(self, foo=1, bar=2, buz="3"):
import re
import sys
from datetime import datetime
from subprocess import run, PIPE
from urllib.parse import urlparse
from jinja2 import Template
from github import Github
re_refs = re.compile(r"^refs/pull/(?P<pr_number>\d+)/head$")
@shkumagai
shkumagai / pyside2setup.sh
Last active August 17, 2017 01:01
bootstrap of PySide2 (not works for Darwin)
#!/bin/bash
# -*- coding: utf-8 -*-
# Prerequisites: Qt5.9 installed
brew install cmake p7zip
# clone repository
git clone https://code.qt.io/pyside/pyside-setup && cd pyside-setup
# download clang installation
ServerAliveInterval 60
IdentitiesOnly yes
IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/id_ecdsa
ForwardAgent yes
#
# General Proxy Setting (http://bit.ly/1MD3d24)
#
@shkumagai
shkumagai / fortune.txt
Last active February 24, 2016 01:23
my fortune in Feb 2016
くまさんの
基本運勢
2016/2/1-2016/2/29の空模様
■双子座
忙しい時期が続いていますが、一月よりもずっと流れがよくなっていて、ストレスは軽くなっているはずです。
ただ忙しいだけでなく、やったことがきちんと成果に結びついているので、やりがいも日増しに大きくなっていくでしょう。
また、日々積み重ねていることから、「さらに、もっと大きなことをやってみたい」「もっと広い場所に出てみたい」「もう少し難しいことに挑戦してみたい」といったような「欲」が出てくるかもしれません。
この「欲」は、貴方をどんどん強く、大きくしてくれる、「魔法」のようなものです。
@shkumagai
shkumagai / how_to_write_go_code.rst
Last active March 30, 2023 03:54
How to Write Go Code
@shkumagai
shkumagai / modulesetup.py
Last active October 5, 2018 03:14
module setup script for Python
#!/usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
"""
modulesetup - setup script for python module skelton
usage:
# execute script like this,
$ python modulesetup foo.bar.buz
@shkumagai
shkumagai / using-unicode-in-erlang_ja.rst
Last active January 31, 2018 09:53
using unicode in erlang [ja]
@shkumagai
shkumagai / memo.rst
Last active December 14, 2015 22:59
How to install Emacs 24.3 on Mac OS

Emacs 24.3 install on Mac OS X

date

Fri 3/15 00:39:04 2013

Download