Skip to content

Instantly share code, notes, and snippets.

@mollifier
mollifier / body.sh
Created September 5, 2013 15:14
開始行と終了行を指定して、ファイルのその範囲内だけを出力するシェルの関数
# 開始行と終了行を指定して、ファイルのその範囲内だけを出力するシェルの関数です。
# bash, zsh で動作します。
# 使い方の例
# body 10,20 file1.txt
function body() {
if [[ $# -eq 0 || "$1" == "-h" || "$1" == "--help" ]] ; then
cat << EOF
usage: $0 [START],[END] [FILE]
Output FILE from START to END line.
@mollifier
mollifier / _jq
Created July 13, 2013 20:39
Completion script for jq. jq is a lightweight and flexible command-line JSON processor. http://stedolan.github.io/jq/
#compdef jq
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
@mollifier
mollifier / zshrc_useful.sh
Last active April 9, 2024 06:29
少し凝った zshrc
# 少し凝った zshrc
# License : MIT
# http://mollifier.mit-license.org/
########################################
# 環境変数
export LANG=ja_JP.UTF-8
# 色を使用出来るようにする
@mollifier
mollifier / try_zsh.md
Last active January 10, 2019 18:07
zsh を使おう

zsh を使おう

これは2013/02/16に開催された 俺聞け4 の発表資料です。

自己紹介

名前
三宅
@mollifier
mollifier / .zshrc
Last active August 16, 2020 09:51
シンプルな zshrc
# シンプルな zshrc
# License : MIT
# http://mollifier.mit-license.org/
# 環境変数
export LANG=ja_JP.UTF-8
# 補完機能を有効にする
autoload -Uz compinit
compinit
@mollifier
mollifier / file0.sh
Created December 11, 2012 00:08
zsh の vcs\_info に独自の処理を追加して stash 数とか push していない件数とか何でも表示する ref: http://qiita.com/items/8d5a627d773758dd8078
# vcs_info 設定
RPROMPT=""
autoload -Uz vcs_info
autoload -Uz add-zsh-hook
autoload -Uz is-at-least
autoload -Uz colors
# 以下の3つのメッセージをエクスポートする
// ==UserScript==
// @name twitter-average-length2
// @namespace http://www.hatena.ne.jp/mollifier
// @include http://twitter.com/*
// @include https://twitter.com/*
// ==/UserScript==
// Fork of twitter-average-length.user.js (http://gist.github.com/402749)
// original author is hitode909 (http://gist.github.com/hitode909)
// 日付文字列のパース処理に eval を使用しないように変更
@mollifier
mollifier / gist:442344
Created June 17, 2010 16:19
jQuery Text Change Event plugin demo
// twitter incremental search
// jQuery Text Change Event plugin demo
//
// requires
// jQuery 1.4.2
// http://jquery.com/
// jQuery Text Change Event plugin
// http://www.zurb.com/playground/jquery-text-change-custom-event
$(function() {
@mollifier
mollifier / twitterlist.js
Created December 17, 2009 12:29
Jetpack Feature to search tweet in slidebar
// twitterlist.js
// Jetpack Feature to search tweet in slidebar
jetpack.future.import("slideBar");
jetpack.slideBar.append({
icon: "http://a1.twimg.com/a/1260817727/images/favicon.ico",
html: "<h1>Twitter List</h1>" +
"<form>" +
"keyword : <input type='text' id='keyword' value=''></input>" +
// Jetpack Feature : hello-statusbar.js
// ステータスバーのラベルをクリックすると通知する
jetpack.statusBar.append({
html: "Hello",
width: 45,
onReady: function(widget){
$(widget).click(function() {
jetpack.notifications.show("Hello Jetpack!");
});