Skip to content

Instantly share code, notes, and snippets.

View k-hamada's full-sized avatar
💤
WORK IN PROGRESS

k-hamada k-hamada

💤
WORK IN PROGRESS
View GitHub Profile
#!/usr/bin/env ruby
# vim:set fileencoding=UTF-8:
require 'date'
range = (Date.parse("1900-01-01") .. Date.today)
stop = [*(1 .. 9), 11, 22]
result = Hash[stop.map{|i| [i, []]}]
def plus(arg)
arg.to_s.each_char.select{|s| s =~ /\d/}.map(&:to_i).inject(:+)
require 'rake/clean'
task :default => :update
desc "Update, SKK Dict File(SKK-JISYO + Hatena)"
task :update => "SKK-JISYO+hatena.dic"
desc "Download, Hatena Keyword List"
task :hatena => "keywordlist_furigana.csv"
// ==UserScript==
// @name Pixiv Autopagerize Added Thumbnail Patch
// @author k.hamada <[email protected]> http://about.me/k.hamada
// @description AutoPagerizeで継ぎ足したPixivのサムネイルが、検索2ページ目以降でも表示されるようにするパッチ
// @version 1.3
// @updateURL https://raw.github.com/gist/1193500?.user.js
// @include /^https?:\/\/(?:www\.)?pixiv\.net\/(search|tags|new_illust|member_illust|bookmark|bookmark_new_illust|mypixiv_new_illust)\.php/i
// @run-at document-end
// ==/UserScript==
// via. [AutoPagerize_DOMNodeInserted 使用時のテンプレート - twwp](http://d.hatena.ne.jp/taizooo/20101105/1288920138)
// ==UserScript==
// @name sinkan.net + calil.jp
// @namespace http://about.me/k.hamada
// @version 0.1
// @description insert calil.jp link in sinkan.net
// @include http://sinkan.net/*action_item=true*
// @copyright 2012+, k.hamada
// ==/UserScript==
var asin, href, info, link, link_img, parentDiv;
@k-hamada
k-hamada / gist:2550377
Created April 29, 2012 13:10
今後100年間で、今年と同じカレンダーの年を探す
require 'date'
first = Date.new(2012, 1, 1)
last = Date.new(2012, 12, 31)
this_year = [first.wday, last.wday, last.yday]
Enumerator.new{|y|
loop {
first, last = first.next_year, last.next_year
y << [first, last]
$array = array(
array('id' => 'a', 'value' => 11),
array('id' => 'b', 'value' => 12),
array('id' => 'c', 'value' => 13),
array('id' => 'a', 'value' => 21),
array('id' => 'b', 'value' => 22),
array('id' => 'b', 'value' => 32),
);
var_dump(
array_reduce($array, function ($result, $item) {
/*
* EqualHeight.js - v1.0.0
* https://github.com/JorenVanHee/EqualHeight.js
*
* Made by Joren Van Hee
* Under MIT License
*/
;(function ($, window, document, undefined) {
var pluginName = "equalHeight",
source 'https://rubygems.org'
gem 'r-fxxk'
source 'https://rubygems.org'
gem 'r-fxxk'