Skip to content

Instantly share code, notes, and snippets.

View ktsujister's full-sized avatar

Kei Tsuji ktsujister

View GitHub Profile
@v0lkan
v0lkan / nginx.conf
Last active April 2, 2024 18:25
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@fanannan
fanannan / schama
Last active August 29, 2015 13:57
Schemaの紹介
Schemaとは
・Prismatic社製の型チェックライブラリ
・最新版は “0.2.1”
https://github.com/prismatic/schema
@puredanger
puredanger / rps.clj
Created July 10, 2013 12:29
Rock Paper Scissors with core.async
(require 'clojure.core.async :refer :all)
(def MOVES [:rock :paper :scissors])
(def BEATS {:rock :scissors, :paper :rock, :scissors :paper})
(defn rand-player
"Create a named player and return a channel to report moves."
[name]
(let [out (chan)]
(go (while true (>! out [name (rand-nth MOVES)])))
@avescodes
avescodes / Editing Clojure with Emacs
Last active July 5, 2022 13:32
Get started editing Clojure in Emacs with this basic config.
Check out README.md to get started editing Clojure with Emacs.
@keikun17
keikun17 / gist:5027688
Last active December 14, 2015 04:19
jruby 1.6.8 + gem 2.0.0 problem with 'gem install'
$ jruby -v
jruby 1.6.8 (ruby-1.8.7-p357) (2012-09-18 1772b40) (Java HotSpot(TM) 64-Bit Server VM 1.7.0_02) [linux-amd64-java]
$ jruby -S gem --version
2.0.0
$ jruby -S gem install jruby-openssl
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
ERROR: Loading command: install (LoadError)
@awilmore
awilmore / IOUtil.java
Created May 23, 2012 10:18
Fast nio InputStream to OutputStream Copy
package com.awilmore.ioutils;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.WritableByteChannel;
@ghoseb
ghoseb / scaffold.clj
Created March 16, 2012 12:54
Scaffold by Christophe Grand
(defn scaffold
"Print the ancestor method signatures of a given interface."
[iface]
(doseq [[iface methods] (->> iface
.getMethods
(map #(vector (.getName (.getDeclaringClass %))
(symbol (.getName %))
(count (.getParameterTypes %))))
(group-by first))]
(println (str " " iface))
@juno
juno / README.md
Created November 1, 2011 08:40
Install rbenv and ruby-build to Amazon Linux (cloud-init).

Install rbenv and ruby-build to Amazon Linux (cloud-init).

  1. Copy & paste content of user-data.sh to EC2 RunInstances user-data
  2. Then, logging in to EC2 instance as ec2-user and run install-ruby.sh.