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
SELECT sum(小計) AS count, year(日付) AS year FROM 'https://ckan.pf-sapporo.jp/dataset/c89f65e7-45a8-4ab2-b94d-494ae192c70f/resource/b83606f6-3aa2-4e0c-8a1a-509dd36be2ae/download/patients_summary.csv' GROUP BY year ORDER BY year; |
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
#!/usr/bin/env ruby | |
require 'grit' | |
class Database | |
def initialize(path) | |
@repository = Grit::Repo.new(path) | |
end | |
def find(key) |
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
#define LED 13 | |
#define T 100 // speed | |
char *morse_pattern[] = { | |
"._", "_...", "_._.", "_..", ".", ".._.", "__.", | |
"....", "..", ".___", "_._", "._..", "__", | |
"_.", "___", ".__.", "__._", "._.", "...", "_", | |
".._", "..._", ".__", "_.._", "__._", "__.." | |
}; |
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 File.join(File.dirname(__FILE__), 'spec_helper') | |
describe HikiDoc, '(character)' do | |
(1..6).each do |i| | |
it "に#{'!'*i}helloを渡すとH#{i}になる" do | |
HikiDoc.to_xhtml("#{'!'*i}hello").should == "<h#{i}>hello</h#{i}>\n" | |
end | |
end | |
it 'に!!!!!!!helloを渡すと<h6>!hello</h6>になる' do | |
HikiDoc.to_xhtml('!!!!!!!hello').should == "<h6>!hello</h6>\n" |
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
def tapg | |
require 'rubygems' | |
require 'g' | |
tap { g block_given? ? yield(self) : self } | |
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
#!/bin/sh | |
cd .. | |
env -i git reset --hard | |
jekyll |
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
#!/usr/bin/ruby | |
# | |
# Eye-fi receiver | |
# -- An imcomplete implementation of Gallery Remote Protocol Server | |
# by SHIDARA Yoji <[email protected]> | |
# | |
# see http://codex.gallery2.org/Gallery_Remote:Protocol | |
# | |
require 'fileutils' | |
require 'sinatra' |
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
# Rack middleware to insert git commit id into http response header | |
# For Rails, put this script under RAILS_ROOT/config/initializers | |
module Rack | |
class GitCommitHeader | |
def initialize(app) | |
@app = app | |
c = `git rev-parse HEAD`.chomp | |
@commit = (c =~ /^[0-9a-f]{40}$/) ? c : nil | |
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
#!/usr/bin/env ruby1.9 | |
require 'logger' | |
require 'rubygems' | |
require 'net/irc' | |
class IrcClient < Net::IRC::Client | |
def initialize(*args) | |
super |
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
#!/usr/bin/env ruby1.9 | |
# encoding: utf-8 | |
require 'open-uri' | |
require 'rubygems' | |
require 'icalendar' | |
uri = "http://www.google.com/calendar/ical/fvijvohm91uifvd9hratehf65k%40group.calendar.google.com/public/basic.ics" |
NewerOlder