Skip to content

Instantly share code, notes, and snippets.

View keizo042's full-sized avatar

Koichi Nakanishi keizo042

  • japanese company
  • Japan
View GitHub Profile
class Status{}
class Yet : Status{}
class Done: Status{}
class Once<T :Status> {
var value: int
static func get() -> OneTime<Yet> {
return Once<Yet>()
$vim -u NONE --noplugin --startuptime vanilla.log .
$vim --startuptime haskell.log .
$grep STARTED vanilla.log
014.471 000.002: --- VIM STARTED ---
006.658 000.002: --- VIM STARTED ---
006.797 000.002: --- VIM STARTED ---
$grep STARTED haskell.log
355.035 000.002: --- VIM STARTED ---
1842.916 000.002: --- VIM STARTED ---
331.796 000.001: --- VIM STARTED ---
server {
listen 80 http2; #h2を有効化
server_name localhost;
# http2_push_preload on; #preload方式のプッシュを有効化
mruby_access_handler_code '
http2 = Nginx::HTTP2.new
if Nginx::Var.new.host == "http2.example.com"
http2.enable_server_push_preload
else
module Main where
import Control.Concurrent
import Control.Concurrent.MVar
import Control.Exception
main :: IO ()
main = run `catch` report
run :: IO ()
run = do
udp = UDPSocket.new
udp.connect("localhost", 1000)
udp.send( "hello", 0)
newManager :: ManagerSetting -> IO Manager
newManager = undefined
open :: Manager -> String -> Int -> IO Context
open = undefined
connect :: Context -> IO ()
connect = undefined
@keizo042
keizo042 / client.hs
Created August 10, 2017 15:57
Dummy Code to ideal sample for "quic" package
module Main where
import Network.QUIC
-- Dummy Code : Simple QUIC Client to Echo Server
main = do
manager <- newManager defaultManagerSettings
ctx <- handshake manager "loclahost" 8080
send ctx "1st hello"
/usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0/openssl/buffering.rb:125:in `sysread': end of file reached (EOFError)
	from /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0/openssl/buffering.rb:125:in `readpartial'
	from /usr/local/lib/ruby/gems/2.4.0/gems/twitter-6.1.0/lib/twitter/streaming/connection.rb:21:in `stream'
	from /usr/local/lib/ruby/gems/2.4.0/gems/twitter-6.1.0/lib/twitter/streaming/client.rb:119:in `request'
	from /usr/local/lib/ruby/gems/2.4.0/gems/twitter-6.1.0/lib/twitter/streaming/client.rb:92:in `user'
	from /usr/local/lib/ruby/gems/2.4.0/gems/t-3.1.0/lib/t/stream.rb:146:in `timeline'
	from /usr/local/lib/ruby/gems/2.4.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
	from /usr/local/lib/ruby/gems/2.4.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
	from /usr/local/lib/ruby/gems/2.4.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'