Skip to content

Instantly share code, notes, and snippets.

View ompugao's full-sized avatar

ompugao

View GitHub Profile
@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
@ompugao
ompugao / earthquake_mute_plugin.rb
Created April 17, 2013 11:48
earthquake mute plugin
Earthquake.once do
@muting_screen_names ||= []
end
Earthquake.init do
output_filter do |item|
next unless item["_stream"]
item["user"] && !@muting_screen_names.include?(item["user"]["screen_name"])
end

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

#/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'pp'
formula =
["( x[0] or x[2] or !x[4] )",
"( !x[3] or !x[4] or !x[5] )",
"( !x[2] or !x[4] or x[5] )",
"( !x[1] or x[3] or !x[5] )",
#!/bin/bash
#install ompugao dotfiles
cd
GIT_SSL_NO_VERIFY=1 git clone https://sifi@ompugao.mydns.jp/git/dotfiles.git
cd dotfiles
make install_vim
@ompugao
ompugao / attach-gdb.sh
Last active August 29, 2015 14:03
attach gdb to the process selected via peco
function attach-gdb() {
gdb -p `ps aux | peco | awk '{print $2}' | head -n1`
}
@ompugao
ompugao / buildpcl.sh
Created July 29, 2014 07:06
how to build pcl
git clone git://github.com/mariusmuja/flann.git
cd flann
mkdir build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
sudo make install
sudo checkinstall # to build deb package
git clone git://github.com/PointCloudLibrary/pcl
cd pcl
@ompugao
ompugao / notify.sh
Created July 30, 2014 13:43
build notification
function notify() {
if [ $? = 0 ] ; then
aplay $HOME/path/to/succeed.wav >/dev/null &
notify-send "成功しました!"
else
aplay $HOME/path/to/fail.wav >/dev/null &
notify-send "失敗しました..."
fi
}
@ompugao
ompugao / Dockerfile
Last active December 23, 2019 05:11
Dockerfile for openrave
FROM nvidia/opengl:1.1-glvnd-devel
MAINTAINER Shohei Fujii <fujii.shohei@gmail.com>
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update && apt-get -y upgrade && apt-get install -y debhelper cmake python-dev libxml2-dev libboost-dev ffmpeg zlib1g-dev python-numpy python-sympy desktop-file-utils libboost-filesystem-dev libboost-system-dev libboost-python-dev libboost-thread-dev libboost-date-time-dev pkg-config libhdf5-serial-dev liblapack-dev libboost-iostreams-dev libboost-regex-dev libqt4-dev qt4-dev-tools libqhull-dev libavcodec-dev libavformat-dev libswscale-dev libsimage-dev libode-dev libsoqt4-dev libassimp-dev libbullet-dev python-nose libpcre3-dev git && apt -y clean && rm -rf /var/lib/apt/lists/*
RUN mkdir -p ws
WORKDIR ws