Skip to content

Instantly share code, notes, and snippets.

View igrep's full-sized avatar
Writing in Haskell, TypeScript, or Power Automate

YAMAMOTO Yuji igrep

Writing in Haskell, TypeScript, or Power Automate
View GitHub Profile
igrep / git_menu.vim
Last active August 29, 2015 13:55 — forked from scrooloose/git_menu.vim
Adds git command menu items.
" Put this in ~/.vim/after/nerdtree_plugin/git_menu.vim
" NOTE: I fixed a bug of NERDTree to get this plugin work.
" You may have to cherry-pick or fork the pull request to use this plugin.
" Adds git command menu items
" TODO: Behave like nerdtree_plugin/fs_menu.vim
" Extend nerdtree_plugin/fs_menu.vim without deleting any defalut menu items.
igrep / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
igrep / evalex.rb
Last active August 29, 2015 14:13
require 'strscan'
Token =, :string)
igrep / file0.txt
Last active August 29, 2015 14:16
間違えてmasterやdevelopにpushしてしまうあなたは今すぐこれを.git/hooks/pre-commitにコピペしなさい ref:
current_branch=$(git rev-parse --abbrev-ref HEAD)
warn_branch() {
echo "You can't commit on '$current_branch'!"
case $current_branch in
master) warn_branch; exit 1 ;; # Of cource you can add any other important branches as you need.
igrep / gist:3f71a70e69a7fa051091
Created June 3, 2015 15:57
error when trying to execute github-reader. See
$ npm install
npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.4","npm":"2.10.1"})
node-webkit-winstate@1.1.1 node_modules\node-webkit-winstate
intelli-espower-loader@0.6.0 node_modules\intelli-espower-loader
parse-github-event@0.2.0 node_modules\parse-github-event
bluebird@2.9.27 node_modules\bluebird
igrep / file0.vim
Last active August 29, 2015 14:22
全角アルファベットやひらがな・カタカナを入力しても(ちょっと)いい感じに解釈してくれるvimrc ref:
noremap あ a
noremap い i
noremap う u
noremap え e
noremap お o
noremap ア a
noremap イ i
noremap ウ u
noremap エ e
Termtter plugin.
Mark everytime timeline is updated. inspired by plugin/mark.rb
config.plugins.mark_on_update.set_default( :wrap_color, 'on_red' )
config.plugins.mark_on_update.set_default( :time_format, 'TIMELINE at %R' )
:name => :mark_on_update,
:points => [:post_filter],
#!/usr/bin/ruby -wKu
# vim: set fileencoding=utf-8 :
return the results of both Enumerable#take and Enumerable#drop
module Enumerable
def split_between val
first = true
first_ary = []
require 'socket'
module SocketSpecs
# helper to get the hostname associated to
def self.hostname
# Calculate each time, without caching, since the result might
# depend on things like do_not_reverse_lookup mode, which is
# changing from test to test
Socket.getaddrinfo("", nil)[0][2]
igrep / object-pattern.rb
Created August 24, 2010 03:41
Wacky Ruby
#!/usr/bin/ruby -wKu
# vim: set fileencoding=utf-8 :
class ObjectPattern
def initialize obj, method=:[]
@delegate_object = obj
@delegate_method = method
attr_reader :delegate_object, :delegate_method
def === other