Skip to content

Instantly share code, notes, and snippets.

@yonchu
yonchu / puyo_another.py
Created September 27, 2014 10:58
Puyo in Python
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Puyo in Python.
Original code:
http://qiita.com/arc279/items/d0a0bc2cfc710f7b1ffe
http://okajima.air-nifty.com/b/2011/01/2011-ffac.html
"""
@yonchu
yonchu / gist_test.txt
Created May 13, 2012 11:49
gits test
test
テスト
push テスト
edit on github web
push public
@yonchu
yonchu / twitter_transparency.user.js
Created May 26, 2012 21:38
Twitterのページを半透明にし、背景画像を見やすくするためのGreasemonkey (Chromeでのみ動作確認済み)
// ==UserScript==
// @name Twitter Transparency
// @namespace http://d.hatena.ne.jp/yonchu
// @version 0.0.2
// @description Twitterのページを半透明化し、背景画像を見やすくする。
// @include https://twitter.com
// @include https://twitter.com/*
// @exclude https://twitter.com/settings
// @exclude https://twitter.com/settings/*
// @see http://d.hatena.ne.jp/yonchu/
@yonchu
yonchu / google_search.sh
Created October 23, 2012 01:03
コマンドラインからGoogle検索するスクリプト(主にMac用)
#
# Goolge検索
#
# .bashrc or .zshrc などに設定してご使用する
# もしくは関数の中身を独立したスクリプトにして使用する
#
# e.g.
# $ google <keyword>
#
google() {
@yonchu
yonchu / copy_previous_cmd_to_clipboard.sh
Created October 23, 2012 01:07
直前に実行したコマンドをクリップボードへ(zsh on Mac Only)
# 直前のコマンドをクリップボードへ
# 第1引数:何個前のコマンドか, 未指定時は1個前のコマンドをコピー
#
# Note: .zshrc に設定して使用(エイリアス: pbcc)
#
copy_prev_cmd_to_clipboard () {
if [ -n "$1" ] && ! expr "$1" : '[0-9]*' > /dev/null ; then
echo "error: non-numeric argument" 1>&2
return 1
fi
@yonchu
yonchu / gits.sh
Created October 23, 2012 01:14
Gitリポジトリの色んな情報を表示. どんなリポジトリなのかを瞬時に把握するのに便利
#!/bin/bash
#
# Print detail infomation about current git repository.
#
if ! type git > /dev/null 2>&1; then
echo 'Error: Git is not installed' 2>&1
exit 1
fi
@yonchu
yonchu / edit-command.sh
Created November 19, 2012 12:55
$vim `which command` を手軽に
#!/bin/sh
#
# Edit command source
#
if [ $# -lt 1 ]; then
echo 'Should specify commands you want to edit' 1>&2
exit 1
fi
@yonchu
yonchu / cdsite.sh
Created November 25, 2012 18:32
pythonのsite-packagesディレクトリへ移動(cd)
# Add the following function to ~/.bashrc or ~/.zshrc
function cdsite() {
local py_cmd
py_cmd=`cat << 'EOF'
from __future__ import print_function
import sys
import os
import site
@yonchu
yonchu / directory_aliases.zsh
Created December 3, 2012 21:30
zshでよく使うディレクトリにエイリアスを設定(~/.zshrcに設定して利用します)
### Directory aliases
# e.x.
# $ hash -d hoge=/to/path
# $ ls ~hoge
set_hash_in_links() {
local links=~/links
[ ! -d "$links" ] && return 0
[ $(command ls -1 "$links" | wc -l) -eq 0 ] && return 0
local src
local target
@yonchu
yonchu / zaw.plugin.zsh
Last active December 9, 2015 22:38
zaw for zsh settings
#
# zaw
#
# https://github.com/zsh-users/zaw
# https://github.com/nakamuray/zaw
#
# zsh anything.el-like widget
#
# Execute action by pressing enter key or
# press Meta-enter for alternative action.