- c5.xlarge AWS instance: 4 CPUs, 8 GB RAM
- Ubuntu 18.04
- Go 1.12
- Python 2.7
- Vips 8.7.4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct CloningLab { | |
subjects: Vec<Box<Mammal>>, | |
} | |
trait Mammal { | |
fn walk(&self); | |
fn run(&self); | |
} | |
#[derive(Clone)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/codegangsta/negroni" | |
"github.com/julienschmidt/httprouter" | |
"net/http" | |
) | |
func main() { |
使用下载Ubuntu Desktop ISO镜像(32位64位都可以)。 用光驱启动,选择试用Ubuntu。
访问:http://cdimage.ubuntu.com/ubuntu-core/releases/找到所需要的镜像文件。
使用Ubuntu LiveCD,下载所需镜像到home目录
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
@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]) | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[! | |
-- @return The current time in UTC | |
--]] | |
function gmtime() | |
return os.time(os.date("!*t")); | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder