Skip to content

Instantly share code, notes, and snippets.

package main
import (
"bufio"
"bytes"
"flag"
"fmt"
"github.com/golang/groupcache"
"io"
"net/http"
2023-01-20T12:03:08.033-0800 INFO clickhouse_query_benchmark/main.go:228 Finished in: 195 ms (current cumulative QPS: 3.612197)
2023-01-20T12:03:08.062-0800 INFO clickhouse_query_benchmark/main.go:228 Finished in: 184 ms (current cumulative QPS: 6.544475)
2023-01-20T12:03:08.064-0800 INFO clickhouse_query_benchmark/main.go:228 Finished in: 146 ms (current cumulative QPS: 9.757946)
2023-01-20T12:03:08.098-0800 INFO clickhouse_query_benchmark/main.go:228 Finished in: 140 ms (current cumulative QPS: 11.718576)
2023-01-20T12:03:08.130-0800 INFO clickhouse_query_benchmark/main.go:228 Finished in: 332 ms (current cumulative QPS: 13.372510)
2023-01-20T12:03:08.170-0800 INFO clickhouse_query_benchmark/main.go:228 Finished in: 132 ms (current cumulative QPS: 14.510420)
2023-01-20T12:03:08.209-0800 INFO clickhouse_query_benchmark/main.go:228 Finished in: 211 ms (current cumulative QPS: 15.466822)
2023-01-20T12:03:08.332-0800 INFO clickhouse_query_benchmark/main.go:
@lazywei
lazywei / install_mosh_locally.sh
Created January 25, 2015 05:30 — forked from xiaom/install_mosh_locally.sh
Install mosh server without root permission
#!/bin/sh
# this script does absolutely ZERO error checking. however, it worked
# for me on a RHEL 6.3 machine on 2012-08-08. clearly, the version numbers
# and/or URLs should be made variables. cheers, zmil...@cs.wisc.edu
mkdir mosh
cd mosh
@lazywei
lazywei / The Technical Interview Cheat Sheet.md
Created October 26, 2016 13:10 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
package main
import (
//"bytes"
"fmt"
"github.com/golang/groupcache"
//"image"
_ "image/gif"
_ "image/jpeg"
//"image/png"
@lazywei
lazywei / webserver.go
Last active December 25, 2015 21:29
Groupcache
package main
import (
"bytes"
"fmt"
"github.com/golang/groupcache"
"image"
_ "image/gif"
_ "image/jpeg"
"image/png"
@lazywei
lazywei / HWTemplate.tex
Last active December 23, 2015 08:19 — forked from dcernst/HWTemplate.tex
% --------------------------------------------------------------
% This is all preamble stuff that you don't have to worry about.
% Head down to where it says "Start here"
% --------------------------------------------------------------
\documentclass[12pt]{article}
\usepackage{fontspec,xltxtra,xunicode}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb}
#!/usr/bin/env bash
# Pre-requisites
sudo apt-get -y update
sudo apt-get --no-install-recommends -y install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev vim
# Download and install rbenv
cd ~
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
@lazywei
lazywei / parser.rb
Last active December 20, 2015 09:49
Yahoo! buy parser
require 'nokogiri'
require 'typhoeus'
url = "http://tw.buy.yahoo.com/gdsale/gdsale.asp?gdid=3791541"
r = Typhoeus.get(url)
doc = Nokogiri::HTML(r.body)
specs = {}
@lazywei
lazywei / aoh.coffee
Last active December 17, 2015 22:59
Attack on hubot / 進擊的 hubot
# Description:
# Attack on Hubot AT hipchat.
#
# Commands:
# hubot aoh help - Show rules.
# hubot aoh init me - Create or reset certain user.
# hubot aoh atk user - Attack user.
# hubot aoh hunt - hunt something.
# hubot aoh find user - Display user infomation.