Skip to content

Instantly share code, notes, and snippets.

@kingxsp
kingxsp / 00.imgproxy_vs_alternatives.md
Created July 17, 2020 05:31 — forked from DarthSim/00.imgproxy_vs_alternatives.md
imgproxy vs alternatives benchmark

imgproxy vs alternatives benchmark

Setup

  • c5.xlarge AWS instance: 4 CPUs, 8 GB RAM
  • Ubuntu 18.04
  • Go 1.12
  • Python 2.7
  • Vips 8.7.4
struct CloningLab {
subjects: Vec<Box<Mammal>>,
}
trait Mammal {
fn walk(&self);
fn run(&self);
}
#[derive(Clone)]
@kingxsp
kingxsp / server.go
Last active August 29, 2015 14:27 — forked from jakejscott/server.go
negroni + httprouter
package main
import (
"fmt"
"github.com/codegangsta/negroni"
"github.com/julienschmidt/httprouter"
"net/http"
)
func main() {

准备

使用下载Ubuntu Desktop ISO镜像(32位64位都可以)。 用光驱启动,选择试用Ubuntu。

下载ubuntu-core

访问:http://cdimage.ubuntu.com/ubuntu-core/releases/找到所需要的镜像文件。

使用Ubuntu LiveCD,下载所需镜像到home目录

@kingxsp
kingxsp / deepcopy.lua
Last active August 29, 2015 14:07 — forked from Deco/deepcopy.lua
--[[ deepcopy.lua
Deep-copy function for Lua - v0.2
==============================
- Does not overflow the stack.
- Maintains cyclic-references
- Copies metatables
- Maintains common upvalues between copied functions (for Lua 5.2 only)
TODO
@kingxsp
kingxsp / gmtime.lua
Last active August 29, 2015 14:07 — forked from ichramm/gmtime.lua
--[[!
-- @return The current time in UTC
--]]
function gmtime()
return os.time(os.date("!*t"));
end
# Build dependencies for OpenResty.
sudo apt-get install build-essential libpcre3-dev libssl-dev libgeoip-dev
# Install standard Nginx first so that you get the relevant service scripts installed too
sudo apt-get install nginx
# If you want to access Postgres via Nginx
sudo apt-get install libpq-dev
# docker build -t="rails" .
FROM ubuntu:12.04
RUN apt-get update
## MYSQL
RUN apt-get install -y -q mysql-client libmysqlclient-dev
## RUBY
# Boyer Moore String Search implementation in Python
# Ameer Ayoub <[email protected]>
# Generate the Bad Character Skip List
def generateBadCharShift(term):
skipList = {}
for i in range(0, len(term)-1):
skipList[term[i]] = len(term)-i-1
return skipList