Skip to content

Instantly share code, notes, and snippets.

View kenichi's full-sized avatar

Kenichi Nakamura kenichi

  • Portland, Oregon
View GitHub Profile

sinatra and pry are not friends

i was trying this...

require 'pry'
require 'sinatra'

get '/' do
 binding.pry
@kenichi
kenichi / gist:4067944
Created November 13, 2012 19:47
how do i get an upstream-added submodule?

upstream added vim-less to .gitmodules...

$ cat .gitmodules 
[submodule ".vim/bundle/vim-handlebars"]
	path = .vim/bundle/vim-handlebars
	url = git://github.com/nono/vim-handlebars.git
[submodule ".vim/bundle/nerdtree"]
	path = .vim/bundle/nerdtree
	url = https://github.com/scrooloose/nerdtree.git
@kenichi
kenichi / postgis-2.0-json.patch
Created July 22, 2013 20:00
postgis ebuild diff and patch with geojson for gentoo
diff -ru postgis-2.0.3-orig/configure.ac postgis-2.0.3/configure.ac
--- postgis-2.0.3-orig/configure.ac 2012-12-20 09:38:23.000000000 -0800
+++ postgis-2.0.3/configure.ac 2013-07-22 04:53:15.290999956 -0700
@@ -33,7 +33,7 @@
dnl
AC_PATH_PROG([CPPBIN], [cpp], [])
if test "x$CPPBIN" != "x"; then
- SQLPP="${CPPBIN} -traditional-cpp -P"
+ SQLPP="${CPPBIN} -traditional-cpp -P -C"
else
@kenichi
kenichi / plv8js-9999.ebuild
Created August 2, 2013 22:35
plv8js-9999.ebuild for gentoo portage
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
inherit git
DESCRIPTION="PL/V8 Javascript for PostgreSQL"
HOMEPAGE="https://code.google.com/p/plv8js/"
@kenichi
kenichi / waldocanyon.geojson
Created August 7, 2013 17:17
waldo canyon fire
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
geom geog
rgeo 0.8510518256839603 78198.3596190946
postgis 0.85105182568396 78189.9134208575

RGeo

>> f = geomf
=> #

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:

@kenichi
kenichi / wsd.rb
Last active September 8, 2015 20:49
WebSocket::Driver client example with Celluloid::IO
require 'websocket/driver'
require 'socket'
require 'forwardable'
require 'celluloid/io'
class WSDTester
include Celluloid::IO
include Celluloid::Logger
extend Forwardable
@kenichi
kenichi / test.rb
Created March 25, 2014 16:07
minitest "server gets a post" example with timeout and server thread
require 'minitest/autorun'
require 'httpclient'
require 'socket'
require 'timeout'
describe 'server gets post' do
it 'gets a post' do
timeout = Timeout.timeout 5 do
@kenichi
kenichi / angelo app output
Created April 2, 2014 22:26
using sinatra/puma to test long-wait calls to other services from angelo/reel
$ 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