This file contains 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
{ | |
"name": "ChromeExtensionSolver", | |
"version": "1.0", | |
"description": "Open the first card and show background color of the card.", | |
"content_scripts": [ | |
{ | |
"matches": [ | |
"http://gdd-2011-quiz-japan.appspot.com/webgame/problem*" | |
], | |
"js": [ |
This file contains 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
gets.to_i.times do | |
gets | |
nums = gets.split(' ').map(&:to_i) | |
queue = [[nums, 0]] | |
while !queue.empty? | |
node, ct = queue.shift | |
if (node.all? { |x| x % 5 == 0}) | |
puts ct + 1 | |
break | |
end |
This file contains 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
package main | |
import ( | |
"fmt" | |
"io" | |
"strings" | |
"image/png" | |
) | |
func CountColor(pngdata io.Reader) int { |
This file contains 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 'pp' | |
class Bar | |
attr_accessor :foo_bars | |
def initialize(&block) | |
@foo_bars = [] | |
yield self | |
end | |
def foo_bar(&block) |
This file contains 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 -*- | |
# GEPUB::Builder example. | |
require 'ruby gem' | |
require 'gepub' | |
builder = GEPUB::Builder.new { | |
# In the root block, you can define metadata. | |
# You can define title, creator(s), contributor(s), publisher(s), date, unique_identifier, identifier, language. | |
# Title can be specified with title, subtitle, collection, short_title, expanded_title, edition. | |
# You can also define description, format, relation, right, source, subject, type. |
This file contains 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
@page :first { | |
margin: 0; | |
} |
This file contains 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
$ gem install nokogiri | |
$ ruby zen-to-han.rb < source.html > destination.html |
This file contains 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
% zundoko-kiyoshi in postscript | |
/Palatino-Italic findfont 40 scalefont setfont | |
/height 50 def | |
clippath pathbbox /top exch def pop pop pop newpath | |
10 top moveto | |
/zd { | |
rand 2 mod 0 eq |
This file contains 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
# Write this in Macro Panel and click on the Run button | |
for myFont in Glyphs.fonts: | |
for ins in myFont.instances: | |
print "Exporting:", ins.familyName | |
ins.generate(Format='TTF',AutoHint=False, RemoveOverlap=False,FontPath='path_to_the_converted_fonts/') |
This file contains 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
pockebell = [%w(わ を ん ゛ °), | |
%w(あ い う え お),%w(か き く け こ),%w(さ し す せ そ), | |
%w(た ち つ て と),%w(な に ぬ ね の),%w(は ひ ふ へ ほ), | |
%w(ま み む め も),%w(や ( ゆ )よ),%w(ら り る れ ろ)] | |
s = ARGV[0].strip.scan(/.{1,2}/).map do |c| | |
a,b = c.split(//) | |
pockebell[a.to_i][b.to_i - 1] | |
end | |
puts s.join |