Skip to content

Instantly share code, notes, and snippets.

View okomestudio's full-sized avatar

Taro Sato okomestudio

View GitHub Profile
@okomestudio
okomestudio / company-tern.el
Created May 17, 2020 01:44
Emacs company-tern mode source
;;; company-tern.el --- Tern backend for company-mode -*- lexical-binding: t -*-
;; Copyright (C) 2013-2016 by Artem Malyshev
;; Author: Artem Malyshev <proofit404@gmail.com>
;; URL: https://github.com/proofit404/company-tern
;; 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
okomestudio / ca.py
Created May 7, 2014 22:20
An example of correspondence analysis.
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
from numpy.linalg import svd
class CA(object):
"""Simple corresondence analysis.
@okomestudio
okomestudio / jwasham-anki-builder.py
Created July 20, 2020 23:31
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
okomestudio / table-1.5.54.el
Created June 30, 2020 21:55
Create and edit WYSIWYG text based embedded tables
;;; 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 <Takaaki.Ota@am.sony.com>
;; Maintainer: Takaaki Ota <Takaaki.Ota@am.sony.com>
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""S3DistCp
Run S3DistCp via boto. Currently only a limited set of S3DistCp
options useful for preparing AWS/EMR input data are exposed.
For details of S3DistCp options, see Distributed Copy Using S3DistCP:
http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/UsingEMR_s3distcp.html
@okomestudio
okomestudio / wait_for
Last active April 10, 2020 05:36
wait_for script for Docker
#!/bin/sh
TIMEOUT=15
QUIET=0
echoerr() {
if [ "$QUIET" -ne 1 ]; then printf "%s\n" "$*" 1>&2; fi
}
usage() {
@okomestudio
okomestudio / rmold.bash
Created April 1, 2020 06:20
rmold: Remove only old files
#!/usr/bin/env bash
set -e
readonly scriptname="${0##*/}"
function usage() {
cat <<USAGE >&2
Usage: $scriptname EXPIRE FILE
@okomestudio
okomestudio / shut_down_nas.bash
Created February 18, 2020 21:12
Shutdown script for Netgear ReadyNAS (RN312)
#!/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
okomestudio / google_style_docstrings.py
Created August 4, 2017 23:53
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.
Example:
Examples can be given using either the ``Example`` or ``Examples``
sections. Sections support any reStructuredText formatting, including
@okomestudio
okomestudio / arc_setup.sh
Created February 9, 2016 21:10 — forked from thomas-barthelemy/arc_setup.sh
W.E. Bridge Phabricator Arcanist (arc) Setup script for Ubuntu
#!/bin/bash
if [ -z "$1" ]; then
echo -e "Missing 1 parameter: Phabricator URL."
echo -e "ex: arc_setup.sh https://phabricator.mycompany.com"
fi
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
fi