Skip to content

Instantly share code, notes, and snippets.

View anfernee's full-sized avatar

Yongkun Anfernee Gui anfernee

  • Google
  • San Francisco Bay area
View GitHub Profile

iperf result when vhost is enabled:

root@anfernee-XPS-8700:/home/anfernee/VM/images# iperf3 -c 192.168.122.41
Connecting to host 192.168.122.41, port 5201
[  5] local 192.168.122.1 port 50716 connected to 192.168.122.41 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  4.72 GBytes  40.6 Gbits/sec    0   1.95 MBytes       
[  5]   1.00-2.00   sec  4.97 GBytes  42.7 Gbits/sec    0   2.64 MBytes       
@davecheney
davecheney / bm_test.go
Last active May 10, 2024 18:30
Which is faster ? map[string]bool or map[string]struct{} ?
package bm
import (
"testing"
)
var mb = map[string]bool{
"alpha": true,
"beta": true,
"gamma": true,
@julienschmidt
julienschmidt / words.go
Last active June 9, 2016 20:17
Find all sub-sequence permutations of a given word in a dictionary
package main
import (
"bytes"
"fmt"
"io/ioutil"
"strings"
)
var index64 = [64]int{
@nakamuray
nakamuray / tornado_wsgi_pool.py
Created June 5, 2013 08:27
running WSGI application on Tornado using thread pool
from concurrent import futures
from tornado import escape, gen, web
from tornado.wsgi import WSGIContainer
class WSGIHandler(web.RequestHandler):
thread_pool_size = 10
def initialize(self, wsgi_application):
self.wsgi_application = wsgi_application
@jacaetevha
jacaetevha / create_sequel_migration.sh
Created June 15, 2011 13:31
Creates a skeleton migration file for Sequel in a timestamp format
#!/bin/sh
if [[ "$@" =~ -(-)?h(elp)? ]]
then
echo ''
echo 'This script will create a skeleton migration in a given directory for a given name.'
echo 'It accepts up to two parameters.'
echo ''
echo ' 1. name of the migration (e.g. table name or description of table alteration)'
echo ' 2. directory for migration (default: db/migrations)'
@tmm1
tmm1 / gist:329682
Created March 11, 2010 21:31
EM Chat Server Demo
require 'rubygems'
require 'eventmachine'
require 'em-http' # gem install em-http-request
require 'yajl' # gem install yajl-ruby
class String
def bold
"\033[1m#{self}\033[0m"
end
end