Skip to content

Instantly share code, notes, and snippets.

View gvimrc.vim
inoremap <silent> <ESC> <ESC>:call system("ore_ime stop")<CR>
@yaasita
yaasita / migemo.vim
Last active Aug 29, 2015
migemo on/off
View migemo.vim
command! Migemo call Migemo()
function! Migemo()
if hasmapto('\<CR>','c')
cunmap <expr><CR>
else
cnoremap <expr><CR> migemosearch#replace_search_word()."\<CR>"
endif
endfunction
View category_list.rb
# encoding: utf-8
#
# Month List for Octopress
module Jekyll
class CatList < Liquid::Tag
def initialize(tag_name, markup, tokens)
super
end
def render(context)
View mail.tcl
#!/usr/bin/expect
set timeout 10
spawn telnet mail.example.com 25
expect {
default {exit 2}
"ESMTP Postfix"
}
# helo
send "HELO sender.example.com\n"
@yaasita
yaasita / gist:9948279
Created Apr 3, 2014
auto_make_script_log.sh
View gist:9948279
if [ "$SHLVL" = "1" ] && [ ! -z "$PS1" ] ; then
[ -d ~/oplog/ ] || mkdir ~/oplog
find ~/oplog/ -type f -mtime +60 -delete
script ~/oplog/"typescript_$(date '+%Y%M_%H:%M:%S')"
fi
View jdprpr.pl
#!/usr/bin/perl
my (@row,@columns);
{
my $line=<STDIN>;
my ($height,$width)=split(/\s+/,$line);
for (1..$height){
$line=<STDIN>;
chomp $line;
$row[$_-1]=$line;
View hddtemp2graph.pl
#!/usr/bin/perl
use File::Temp;
use strict;
use warnings;
# grep
my $temp_grep_log=File::Temp->new(DIR=>"/tmp",SUFFIX=>".tmp");
my $temp_grep_log_name=$temp_grep_log->filename;
system "cat /var/log/syslog | grep '°' > $temp_grep_log_name ";
# make gnuplot data
@yaasita
yaasita / bunkai.pl
Last active Aug 29, 2015
blogger2middleman
View bunkai.pl
#!/usr/bin/perl
use strict;
use warnings;
open (FH,"blog-05-10-2014_2.xml") or die $!;
while (<FH>){
if (/^<entry>/){
open (WR,">/tmp/out/${.}.erb") or die $!;
}
if (/^<entry>/../^<\/entry>/){
View auto_suspend.sh
#!/bin/bash
DISPLAY=:0
function previous {
sleep $1
eval $(xdotool getmouselocation --shell)
echo "$X,$Y"
}
while :;do
View update.sh
#!/bin/bash
set -e
#rbenv
HOME=/home/hogeuser
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
cd ~/middleman