Skip to content

Instantly share code, notes, and snippets.

inoremap <silent> <ESC> <ESC>:call system("ore_ime stop")<CR>
@yaasita
yaasita / migemo.vim
Last active August 29, 2015 13:56
migemo on/off
command! Migemo call Migemo()
function! Migemo()
if hasmapto('\<CR>','c')
cunmap <expr><CR>
else
cnoremap <expr><CR> migemosearch#replace_search_word()."\<CR>"
endif
endfunction
# encoding: utf-8
#
# Month List for Octopress
module Jekyll
class CatList < Liquid::Tag
def initialize(tag_name, markup, tokens)
super
end
def render(context)
#!/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 April 3, 2014 04:28
auto_make_script_log.sh
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
@yaasita
yaasita / jdprpr.pl
Last active August 29, 2015 13:59
paiza
#!/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;
#!/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 August 29, 2015 14:01
blogger2middleman
#!/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>/){
#!/bin/bash
DISPLAY=:0
function previous {
sleep $1
eval $(xdotool getmouselocation --shell)
echo "$X,$Y"
}
while :;do
#!/bin/bash
set -e
#rbenv
HOME=/home/hogeuser
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
cd ~/middleman