Skip to content

Instantly share code, notes, and snippets.


Taro Sato okomestudio

View GitHub Profile
okomestudio /
Created Jul 20, 2020
Convert the CS flash cards by jwasham to CSV for Anki import.
#!/usr/bin/env python
"""Convert the CS flash cards by jwasham to CSV for Anki import.
On import:
- Choose tab as the field separator
- Ignore lines where first field matches existing note
- Allow HTML in fields
okomestudio / table-1.5.54.el
Created Jun 30, 2020
Create and edit WYSIWYG text based embedded tables
View table-1.5.54.el
;;; table.el --- create and edit WYSIWYG text based embedded tables
;; Copyright (C) 2000, 2001 Takaaki "Tak" Ota
;; Emacs Lisp Archive Entry
;; Filename: table.el
;; Version: 1.5.54
;; Keywords: wp, convenience
;; Author: Takaaki Ota <>
;; Maintainer: Takaaki Ota <>
okomestudio / company-tern.el
Created May 17, 2020
Emacs company-tern mode source
View company-tern.el
;;; company-tern.el --- Tern backend for company-mode -*- lexical-binding: t -*-
;; Copyright (C) 2013-2016 by Artem Malyshev
;; Author: Artem Malyshev <>
;; URL:
;; Version: 0.3.0
;; Package-Requires: ((company "0.8.0") (tern "0.0.1") (dash "2.8.0") (dash-functional "2.8.0") (s "1.9.0") (cl-lib "0.5.0"))
;; This program is free software; you can redistribute it and/or modify
okomestudio / wait_for
Last active Apr 10, 2020
wait_for script for Docker
View wait_for
echoerr() {
if [ "$QUIET" -ne 1 ]; then printf "%s\n" "$*" 1>&2; fi
usage() {
okomestudio / rmold.bash
Created Apr 1, 2020
rmold: Remove only old files
View rmold.bash
#!/usr/bin/env bash
set -e
readonly scriptname="${0##*/}"
function usage() {
cat <<USAGE >&2
Usage: $scriptname EXPIRE FILE
okomestudio / shut_down_nas.bash
Created Feb 18, 2020
Shutdown script for Netgear ReadyNAS (RN312)
View shut_down_nas.bash
#!/usr/bin/env bash
set -e
function usage() {
cat <<USAGE >&2
Usage: ${0##*/} [OPTION] [host]
Shut down the network attached server (NAS). This script has been
tested on Netgear ReadyNAS 312 (RN312).
okomestudio /
Created Aug 4, 2017
Google-style docstrings example
# -*- coding: utf-8 -*-
"""Example Google style docstrings.
This module demonstrates documentation as specified by the `Google Python
Style Guide`_. Docstrings may extend over multiple lines. Sections are created
with a section header and a colon followed by a block of indented text.
Examples can be given using either the ``Example`` or ``Examples``
sections. Sections support any reStructuredText formatting, including
okomestudio /
Created Feb 9, 2016 — forked from thomas-barthelemy/
W.E. Bridge Phabricator Arcanist (arc) Setup script for Ubuntu
if [ -z "$1" ]; then
echo -e "Missing 1 parameter: Phabricator URL."
echo -e "ex:"
if ! hash git &> /dev/null || ! hash php &> /dev/null; then
echo -e " *****\n ***** INSTALLING GIT AND PHP\n *****"
sudo apt-get install git-core php5-cli php5-curl
okomestudio /
Last active Jan 14, 2016
Script to delete S3 bucket with contents.
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""Delete a S3 bucket with contents.
from __future__ import absolute_import
from gevent import monkey ; monkey.patch_all()
from argparse import ArgumentParser
import boto3
A Python Singleton mixin class that makes use of some of the ideas
found at Just inherit
from it and you have a singleton. No code is required in
subclasses to create singleton behavior -- inheritance from
Singleton is all that is needed.
Singleton creation is threadsafe.
You can’t perform that action at this time.