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
@shkumagai
shkumagai / conf.py
Created December 6, 2012 04:28
Sample conf.py to hide sidebar
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'bizstyle'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
@shkumagai
shkumagai / howtouse.rst
Created November 2, 2012 10:39
how to use zsh completion script.
  • rebar のリポジトリは clone/pull 済と仮定する
  1. 補完スクリプトを置く場所を作る :

    cd ~
    mkdir -p .zsh.d/comp

    パスはどこでもいいけど、分かりやすいところに。

  2. _rebar をコピーする :
@shkumagai
shkumagai / _rebar
Created October 30, 2012 01:26
zsh completion script for rebar
This completion script of zsh was adopted by rebar.
@shkumagai
shkumagai / conf.py
Created October 16, 2012 15:19
How to write fallback setting for sphinxjp.themes.* are not found.
try:
import sphinxjp.themecore
extensions.append('sphinxjp.themecore')
except ImportError:
extensions = []
try:
import sphinxjp.themes.bizstyle
html_theme = 'bizstyle'
@shkumagai
shkumagai / gist:2694512
Created May 14, 2012 15:14
Can I use regex in case expression?
#!/bin/sh
case $1 in
[1-9])
echo "Less than 10: $1"
;;
[1-9][0-9])
echo "Greater than equal 10, and Less than 100: $1"
;;
*)
@shkumagai
shkumagai / digest_sample.pl
Created May 9, 2012 02:23
How to use add_bits() function in Digest::SHA
use strict;
use warnings;
use Digest::SHA;
# Using sha256 algorism
our $ctx = Digest::SHA->new(256);
sub bit_to_digest {
my ($bits) = @_;