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目录

1. Create a jquery.cleditor.i18n.js file and make it look like this:
CLEDITOR_I18N = {
"Align Text Left": "Aliniază la stânga",
"Center": "Centrează",
"Align Text Right": "Aliniază la dreapta",
// etc.
}
/**
@preserve CLEditor WYSIWYG HTML Editor v1.3.0-i18n
http://premiumsoftware.net/cleditor
requires jQuery v1.4.2 or later
Copyright 2010, Chris Landowski, Premium Software, LLC
Dual licensed under the MIT or GPL Version 2 licenses.
made i18n ready by scribu ([email protected])
*/
@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
import asyncio
import requests
@asyncio.coroutine
def main():
loop = asyncio.get_event_loop()
future1 = loop.run_in_executor(None, requests.get, 'http://www.google.com')
future2 = loop.run_in_executor(None, requests.get, 'http://www.google.co.uk')
response1 = yield from future1
response2 = yield from future2