Skip to content

Instantly share code, notes, and snippets.

View morygonzalez's full-sized avatar
🌴
I may be slow to respond.

Hitoshi Nakashima morygonzalez

🌴
I may be slow to respond.
View GitHub Profile
@morygonzalez
morygonzalez / asahibyun.rb
Last active August 29, 2015 14:03 — forked from hagiyaki/asahibyun.rb
httpclient なし、要 nokogiri
# -*- coding: utf-8 -*-
# superdry tweet / earthquake plugin
#
# superdry: http://shindanmaker.com/43570
#
require 'net/http'
require 'nokogiri'
Earthquake.init do
command :byunasahi do
@morygonzalez
morygonzalez / rt_rt_filter.rb
Last active August 29, 2015 14:01 — forked from siyo/rt_rt_filter.rb
多段非公式RTフィルタ earthquake.gem plugin (invalid byte sequence in UTF-8 (ArgumentError) 対応版)
# -*- coding: utf-8 -*-
require 'utf8-cleaner'
Earthquake.init do
output_filter do |item|
next if item.nil? || item["text"].nil?
str = UTF8Cleaner::URIString.new(item["text"]).cleaned
!(/^.+[¥"QR]T(?:[:\s]*@[A-Za-z0-9_]|\(via[:\s]*@[A-Za-z0-9_]).+[¥"QR]T/ =~ str)
end
end
@morygonzalez
morygonzalez / favstar.rb
Created September 13, 2012 09:03 — forked from siyo/favstar.rb
favstar ふぁぼったりRTしたユーザ名も見るやつ(色つき) / earthquakge.gem plugin
# -*- coding: utf-8 -*-
# favstar / earthquakge.gem plugin
#
# e.g. :favstar #=> your favstar
# :favstar who #=> who's favstar
#
require 'open-uri'
require 'nokogiri'
Earthquake.init do
@morygonzalez
morygonzalez / takagi.rb
Created July 5, 2012 01:58 — forked from siyo/takagi.rb
高木っぽいRT plugin.rb
# -*- coding: utf-8 -*-
# takagi RT
#
# e.g. :takagi $xx
#
Earthquake.init do
command %r|^:takagi\s+(\d+)$|, :as => :takagi do |m|
st = cache.read("status:" + m[1])
text = sprintf("だったら黙ってろクソが RT @%s %s" % [st["user"]["screen_name"], st["text"]])
async_e { twitter.update(text, :in_reply_to_status_id => m[1]) } if confirm("update '#{text}'")
@morygonzalez
morygonzalez / github-follow-organization.user.js
Created May 14, 2012 02:58 — forked from technolize/github-follow-organization.user.js
github の organization ページにもフォローボタンを表示する
// ==UserScript==
// @name follow organization
// @description Show follow button on github organization page
// @namespace http://www.portalshit.net/
// @include https://github.com/*
// @version 0.1
// @license MIT License
// @work Google Chrome
// ==/UserScript==
@morygonzalez
morygonzalez / screen_name_prompt.rb
Created April 24, 2012 09:27 — forked from ryumu/screen_name_prompt.rb
Earthquake.gemのプロンプトにユーザー名を出すよ!プラグイン(色つき)
# coding: UTF-8
Earthquake.init do
once do
user = twitter.info['screen_name']
config[:prompt] = user.c(color_of(user)) + config[:prompt]
end
end
@morygonzalez
morygonzalez / script
Last active October 19, 2015 03:41 — forked from negipo/script
/Applications/Gyazo.app/Contents/Resources/script
#!/usr/bin/env ruby
require 'fileutils'
require 'digest/md5'
def main
user = IO.popen("whoami", "r+").gets.chomp
file = "/Users/#{user}/Dropbox/Public/gyazo/#{Digest::MD5.hexdigest(Time.now.to_f.to_s)}.png"
url = 'https://dl.dropboxusercontent.com/u/2611378/gyazo/' + File.basename(file)
@morygonzalez
morygonzalez / .zshrc
Created February 2, 2012 09:48 — forked from youpy/.zshrc
play music during command execution
p() {
local pid exit
# http://www.filesonic.com/file/703099021
afplay ~/Music/Nyan\ Cat.mp3 &
pid=$!
trap "kill -9 $pid" INT
command $*
exit=$?
kill -9 $pid
trap INT
@morygonzalez
morygonzalez / ogyohee.rb
Created January 14, 2012 13:02 — forked from DOGEME/ogyohee.rb
オギョヒーっていう時用 / earthquake.gem plugin
# -*- coding: utf-8 -*-
# ogyohee tweet / earthquake plugin
#
# ogyohee: http://shindanmaker.com/152454
#
require 'net/http'
Earthquake.init do
command %r|^:ogyo\s*(.+)*|, :as => :ogyohee do |m|
url = "http://shindanmaker.com/152454"
@morygonzalez
morygonzalez / favstar.rb
Created November 28, 2011 14:41 — forked from siyo/favstar.rb
favstar 見るやつ(色つき) / earthquakge.gem plugin
# -*- coding: utf-8 -*-
# favstar / earthquakge.gem plugin
#
# e.g. :favstar #=> your favstar
# :favstar who #=> who's favstar
#
require 'rss'
Earthquake.init do