Skip to content

Instantly share code, notes, and snippets.

View ompugao's full-sized avatar

ompugao

View GitHub Profile
@ompugao
ompugao / ga_ruby.rb
Created March 26, 2012 16:50
ga system written in Ruby
module GaRuby
class GaRubyError < StandardError ; end
class Gene
attr_acessor :data,:value
def initialize(gen_num=nil)
@value=0
if block_given?
@data=Array.new(gen_num){yield}
else
@ompugao
ompugao / jeweler-ruby19.patch
Created April 2, 2012 11:08
patch to a source coded automatically generated by jeweler
diff --git a/Gemfile b/Gemfile
index eedb107..6d26f41 100644
--- a/Gemfile
+++ b/Gemfile
@@ -8,7 +8,7 @@ source "http://rubygems.org"
group :development do
gem "rspec", "~> 2.8.0"
gem "rdoc", "~> 3.12"
- gem "bundler", "~> 1.0.0"
+ gem "bundler", ">= 1.0.0"
@ompugao
ompugao / notify_growl.rb
Created May 21, 2012 12:22
earthquake growl notify
require 'ruby_gntp'
Earthquake.init do
output do |item|
next unless item["_stream"]
if item["text"]
GNTP.notify({:app_name => "earthquake",:title => item["user"]["screen_name"],:text => item["text"],:icon => item["user"]["profile_image_url"]})#icon_path(user.screen_name, user.profile_image_url) })
#if /@sifikinoko(?:[\s:]|$)/ =~ item["text"]
# system{
# 'notify-send',
# '--urgency','critical',

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@ompugao
ompugao / gollum.conf
Created September 7, 2012 14:30 — forked from leon/gollum.conf
Gollum Upstart script
#
# Install:
# install https://github.com/github/gollum
# in /srv/wiki do a git init
# add this script to /etc/init/gollum.conf
#
# Usage:
# start/stop/restart gollum
#
@ompugao
ompugao / fasd.vim
Created September 23, 2012 10:34
fasd integration to vim
" Z - cd to recent / frequent directories
command! -nargs=* Z :call Z(<f-args>)
function! Z(...)
let cmd = 'fasd -d -l -e printf'
for arg in a:000
let cmd = cmd . ' ' . arg
endfor
let pathes = split(system(cmd),"\n")
for i in range(0,len(pathes)-1)
echo i ." " . pathes[i]
@ompugao
ompugao / rosvim.vim
Created October 8, 2012 06:36
ros integration to vim
" Vim global plugin for working with ROS
" Maintainer: Michael Styer <michael@styer.net>
" Fixed by : Fujii Shohei <fujii.shohei@gmail.com>
" Helper commands
function! s:RosDecodePath(path)
let rosname = ""
let reldir = ""
let rosdir = ""
let last = ""
@ompugao
ompugao / config
Last active October 13, 2015 03:57
termtter config
# -*- coding: utf-8 -*-
# vim: filetype=ruby
config.token_file = "~/.termtter/token"
#config.dmsg_permission = true
config.update_interval = 30
config.timeout = 60
#config.retry = 3
#config.enable_ssl = true
@ompugao
ompugao / mute.rb
Created December 4, 2012 09:56
termtter plugin to mute some user/word
# -*- coding: utf-8 -*-
config.filters.mute.set_default(:words, [])
config.filters.mute.set_default(:users, [])
module Termtter::Client
register_hook(
:name => :mute,
:point => :filter_for_output,
:exec => lambda { |statuses, event|
@ompugao
ompugao / edic
Created December 5, 2012 04:17
english dictionary from terminal
[ $# -eq 0 ] && echo "No arguments" && exit 0
value="$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$*")"
curl "http://eow.alc.co.jp/${value}/UTF-8/" 2>/dev/null | w3m -T text/html | sed -e "1,36d" | less
# this script needs curl,w3m,liburi-perl.
# If you use ubuntu,try this command
# sudo aptitude install curl w3m liburi-perl