This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Titech Portal Auto Login | |
// @namespace http://www.titech.ac.jp/ | |
// @id [email protected] | |
// @description 東工大ポータルに自動的にログインします | |
// @author NAKASHIMA, Makoto <[email protected]> | |
// @include https://portal1.nap.gsic.titech.ac.jp/* | |
// @include https://portal.nap.gsic.titech.ac.jp/* | |
// @include http://portal.titech.ac.jp/* | |
// @jsversion 1.8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require "net/http" | |
require "uri" | |
uri = URI.parse("http://im.kayac.com/api/post/USERNAME") | |
Net::HTTP.start(uri.host, uri.port){|http| | |
request = Net::HTTP::Post.new(uri.path) | |
request.set_form_data({:message=>"MESSAGE"}) | |
response = http.request(request) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'oauth' | |
require 'thor' | |
require 'thor/group' | |
class Auth < Thor::Group | |
include Thor::Actions | |
def get_pid | |
consumer = OAuth::Consumer.new( | |
'IQKbtAYlXLripLGPWd0HUA', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'user_stream' | |
require 'twitter' | |
require "net/http" | |
require "uri" | |
def notify(message) | |
uri = URI.parse("http://im.kayac.com/api/post/USERNAME") | |
Net::HTTP.start(uri.host, uri.port){|http| | |
request = Net::HTTP::Post.new(uri.path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'RMagick' | |
bmp_file_name = ARGV[0] | |
image = Magick::Image.read(bmp_file_name).first | |
top_left_pixel = image.pixel_color(0, 0) | |
top_left_color = top_left_pixel.to_color(Magick::AllCompliance, false, 8, true) | |
png_file_name = bmp_file_name.gsub(/bmp$/, 'png') | |
`convert -transparent "#{top_left_color}" #{bmp_file_name} #{png_file_name}` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'twitter' | |
Twitter.configure do |config| | |
config.consumer_key = '' | |
config.consumer_secret = '' | |
config.oauth_token = '' | |
config.oauth_token_secret = '' | |
end | |
print "Input list name: " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --- Usage --- | |
# ruby kmb.rb init | |
# ruby kmb.rb change | |
require 'twitter' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'fileutils' | |
Twitter.configure do |config| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if git-rev-parse --verify HEAD >/dev/null 2>&1 | |
then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on ruby/benchmark/bm_erb_render.rb | |
require 'benchmark/ips' | |
require 'erb' | |
require 'erubi' | |
require 'erubis' | |
data = DATA.read | |
mod = Module.new | |
mod.instance_eval("def self.erb(title, content); #{ERB.new(data).src}; end", "(ERB)") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat benchmark.yml | |
# Config for benchmark_driver.gem | |
type: command_stdout | |
name: optcarrot | |
command: bin/optcarrot --benchmark examples/Lan_Master.nes | |
metrics_type: | |
unit: fps | |
stdout_to_metrics: | | |
match = stdout.match(/^fps: (?<fps>\d+\.\d+)$/) | |
Float(match[:fps]) |
OlderNewer