Keybase proof
I hereby claim:
- I am kenichi on github.
- I am kenichi (https://keybase.io/kenichi) on keybase.
- I have a public key whose fingerprint is EFC6 3195 D624 70E1 90FD 2816 41AA 0C27 16BC E95F
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
require 'minitest/autorun' | |
require 'httpclient' | |
require 'socket' | |
require 'timeout' | |
describe 'server gets post' do | |
it 'gets a post' do | |
timeout = Timeout.timeout 5 do |
$ be ruby concurrency_test_app.rb -p 5000 | |
I, [2014-04-02T15:15:12.467887 #1602] INFO -- : Angelo 0.1.5 | |
I, [2014-04-02T15:15:12.468080 #1602] INFO -- : listening on 127.0.0.1:5000 | |
D, [2014-04-02T15:15:27.794593 #1602] DEBUG -- : 127.0.0.1 - - "GET /asynch_test HTTP/1.1" 200 11 | |
D, [2014-04-02T15:15:28.887823 #1602] DEBUG -- : 127.0.0.1 - - "GET /asynch_test HTTP/1.1" 200 11 |
kzerza:terraformer-ruby $ irb -I./lib -rterraformer | |
>> f = Terraformer::Feature.new | |
=> #<Terraformer::Feature:0x00000000d90468> | |
>> f.geometry = Terraformer::Coordinate.new(-122.6764, 45.5165).buffer 100; nil | |
=> nil | |
>> puts f.to_json | |
{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-122.67550601034951,45.516562033665174],[-122.67551894559217,45.51662290132699],[-122.67554036587042,45.51668278727813],[-122.67557006489525,45.51674070977981],[-122.67560775664884,45.516796668829606],[-122.67565307813899,45.51684968268687],[-122.67570559289496,45.516899751348255],[-122.67576479517095,45.51694491133269],[-122.67583011481669,45.51698614437468],[-122.67590092276828,45.51702345047074],[-122.67597653710642,45.51705486613829],[-122.67605622962373,45.51708137311326],[-122.67613923283767,45.517101989652815],[-122.67622474738195,45.51711769749451],[-122.67631194970474,45.517126533156244],[-122.6764,45.517129478376944],[-122.67648805029526,45.517126533156244],[-122.67657525261805,45.51711769749 |
# geographic postgis | |
>> DB.get :st.distance( :st.geogfromwkb( :st.makepoint(-122.6764, 45.5165) ), :st.geogfromwkb( :st.makepoint(-122.6864, 45.5265) ) ) | |
=> 1358.549604392 | |
# geomteric postgis (?) | |
>> DB.get :st.distance( :st.transform(:st.setsrid(:st.makepoint(-122.6764, 45.5165), 4326), 3857), :st.transform(:st.setsrid(:st.makepoint(-122.6864, 45.5265), 4326), 3857) ) | |
=> 1939.9894392485 |
require 'angelo' | |
require 'tilt' | |
require 'angelo/tilt/erb' | |
class Chat < Angelo::Base | |
include Angelo::Tilt::ERB | |
@@views = '.' | |
get '/' do |
require 'ruby-prof' | |
class Array | |
def a_slice_exists? ary | |
raise ArgumentError unless Array === ary | |
each_index.select {|i| at(i) == ary[0]}.any? {|i| self[i,ary.length] == ary} | |
end | |
def b_slice_exists? slice |
FROM ubuntu:precise | |
MAINTAINER Kenichi Nakamura <knakamura@esri.com> | |
# set locale | |
RUN locale-gen --no-purge en_US.UTF-8 | |
ENV LC_ALL en_US.UTF-8 | |
ENV LANG en_US.UTF-8 | |
ENV LANGUAGE en_US.UTF-8 | |
RUN echo 'LANG="en_US.UTF-8"' >> /etc/default/locale |