Skip to content

Instantly share code, notes, and snippets.

View shouichi's full-sized avatar

Shouichi Kamiya shouichi

  • Tokyo
  • 14:18 (UTC +09:00)
View GitHub Profile
// Prints dependent packages (including test ones) of the given package.
// $ deps github.com/foo/bar/baz
// net
// net/http
// net/http/httptrace
// net/http/httputil
// net/http/internal
// net/textproto
// net/url
// os
Vagrant.configure('2') do |config|
config.vm.box = 'ubuntu.13.10'
config.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-13.10_chef-provisionerless.box'
[3000, 3080, 3333, 4000, 8000, 8080].each do |port|
config.vm.network :forwarded_port, guest: port, host: port
end
config.ssh.forward_agent = true
if [ -z $SSH_AUTH_SOCK ];
then
eval `ssh-agent` > /dev/null
ssh-add ~/.ssh/id_rsa 2&> /dev/null
fi
#!/usr/bin/env ruby
def reverse(n, reversing = 0)
if n == 0
reversing
else
reverse(n / 10, n % 10 + reversing * 10)
end
end
#!/usr/bin/env ruby
def fibgen
prev, curr = 0, 1
lambda do
temp = prev
prev = curr
curr += temp
temp
end
This file has been truncated, but you can view the full file.
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
{"name":"北海道","cities":[{"name":"札幌市中央区","divisions":[{"name":"旭ケ丘","zip_code":"0640941"},{"name":"大通東","zip_code":"0600041"},{"name":"大通西","zip_code":"0600042"},{"name":"北一条東","zip_code":"0600031"},{"name":"北一条西","zip_code":"0600001"},{"name":"北二条東","zip_code":"0600032"},{"name":"北二条西","zip_code":"0600002"},{"name":"北三条東","zip_code":"0600033"},{"name":"北三条西","zip_code":"0600003"},{"name":"北四条東","zip_code":"0600034"},{"name":"北四条西","zip_code":"0600004"},{"name":"北五条東","zip_code":"0600035"},{"name":"北五条西","zip_code":"0600005"},{"name":"北六条西","zip_code":"0600006"},{"name":"北七条西","zip_code":"0600007"},{"name":"北八条西","zip_code":"0600008"},{"name":"北九条西","zip_code":"0600009"},{"name":"北十条西","zip_code":"0600010"},{"name":"北十一条西","zip_code":"0600011"},{"name":"北十二条西","zip_code":"0600012"},{"name":"北十三条西","zip_code":"0600013"},{"name":"北十四条西","zip_code":"0600014"},{"name":"北十五条西","zip_code":"0600015"},{"name":"北十六条西","zip_code":"0600016"},{"name":"北十七条西","zip_code":"0600017"},{"name":"北十八条西","zip_code":"0600018"},{"n
org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `each' for nil:NilClass
at org.jruby.RubyBasicObject.__send__(org/jruby/RubyBasicObject.java:1703)
at org.jruby.RubyKernel.send(org/jruby/RubyKernel.java:2209)
at JRuby::Rack::Response.write_body(file:/data/app/merchant-directory/installs/merchant-directory_8337a73a968721f156554e9e28d565ea1898d5bf/vendor/jruby-rack.jar!/jruby/rack/response.rb:171)
at JRuby::Rack::Response.write_body(file:/data/app/merchant-directory/installs/merchant-directory_8337a73a968721f156554e9e28d565ea1898d5bf/vendor/jruby-rack.jar!/jruby/rack/response.rb:145)
at JRuby::Rack::Response.respond(file:/data/app/merchant-directory/installs/merchant-directory_8337a73a968721f156554e9e28d565ea1898d5bf/vendor/jruby-rack.jar!/jruby/rack/response.rb:93)
at JRuby$$Rack$$Response_1331249969.respond(JRuby$$Rack$$Response_1331249969.gen:13)
@shouichi
shouichi / pksha.md
Last active December 25, 2015 07:00

Finatra + MySQL + Protobufのススメ

神谷翔一

東大情報科学科出身のエンジニア

主にbackendを書く事が多い

今日伝えたい事

  1. MySQLの少し変わった使い方
  2. Finatra便利
#include <stdio.h>
#include <stdlib.h>
typedef union {
unsigned int i;
float f;
} holder;
void printBits(int x)
{