Skip to content

Instantly share code, notes, and snippets.

View uu59's full-sized avatar

uu59

View GitHub Profile
# -- coding: utf-8
require "net/http"
# ktserver --version
# Kyoto Tycoon 0.9.49 (2.13) on Mac OS X (Kyoto Cabinet 1.2.69)
# ktserver -port 19999 '%'
Net::HTTP.start('localhost', 19999) do |http|
9.times{|n|
// ==UserScript==
// @name Auto-terminate google instant search
// @namespace http://uu59.org/
// @version 1.0.0
// @include http://*.google.*/search*
// ==/UserScript==
(function(){
if(! location.hostname.match(/^www\.google\.[a-z]{2,3}(?:\.[a-z]{2})?$/)){
return ;
unbind C-b
set -g prefix C-j
set -g default-terminal "screen-256color"
set-option -g status-interval 1
set -g display-panes-time 10000
set-window-option -g mode-mouse on
set -g mouse-select-pane on
set-window-option -g mode-keys vi
@uu59
uu59 / error.log
Created September 13, 2011 02:33
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /home/mdis/.rvm/gems/ree-1.8.7-2011.03/gems/rails-2.3.11/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#refresh! is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#refresh! called from /home/mdis/.rvm/gems/ree-1.8.7-2011.03/gems/rails-2.3.11/lib/rails/vendor_gem_source_index.rb:34.
NOTE: Gem::SourceIndex#load_gems_in is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#load_gems_in called from /home/mdis/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:322.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/mdis/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specifica
@uu59
uu59 / ftp.rb
Created September 26, 2011 13:53
# -- coding: utf-8
=begin
Mac or Linux with imagemagick
=end
HOST = "114.160.71.150"
DIR_NAME = "gyazzo"
require "net/ftp"
@uu59
uu59 / pdo.php
Created September 27, 2011 01:46
<?php
// mysql Ver 14.14 Distrib 5.1.54, for debian-linux-gnu (x86_64) using readline 6.2
// PHP 5.3.5-1ubuntu7.2 with Suhosin-Patch (cli) (built: May 2 2011 23:00:17)
// Copyright (c) 1997-2009 The PHP Group
// Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
$pdo = new PDO("mysql:host=localhost; dbname=foo", "root", "root");
$pdo->exec("DROP TABLE IF EXISTS t");
$pdo->exec("CREATE TABLE t (id INTEGER NOT NULL AUTO_INCREMENT, c INTEGER NOT NULL, PRIMARY KEY(id))");
// ==UserScript==
// @name display nicovideo movie thumbnail on watch page
// @namespace http://uu59.org/
// @version 1.0.0
// @include http://www.nicovideo.jp/watch/*
// ==/UserScript==
(function(){
var addCss = function(css){
var head = document.querySelector("head")
@uu59
uu59 / ca.rb
Created October 13, 2011 09:16
# -- coding: utf-8
=begin
http://ameblo.jp/shibuya/entry-11045885401.html
・下位5%をD評価とする
・D評価1回でイエローカード、2回目でレッドカードとなり、2回目で部署異動または退職勧奨のいずれか
このルールで何回目の査定で従業員が0になるか(D評価をつけるべき人がいなくなるか)を計算するスクリプト
=end
@uu59
uu59 / a.rb
Created November 3, 2011 05:02
# -- coding: utf-8
require "rubygems"
require "rspec"
describe do
def to_num(chars)
table = ("A".."Z").to_a
chars = chars.split(//u)
count = 1
(function detectMainContent(){
// based on JimmyWales http://d.hatena.ne.jp/ofk/20101123/1290439104
var scoreCalc = function(elm){
var nodeTable = {
"div": 0,
"article": 50,
"section": 5
};
var clsTable = {
"content": 5,