代码依赖 Node.js 运行环境以及 Python 运行环境。
下面将安装 Node.js 和 Python 运行时:
#!/bin/sh | |
# | |
# Amazon EC2 user-data file for automatic configuration of IPsec/L2TP VPN | |
# on a Ubuntu server instance. Tested with 14.04 (Trusty) AND 12.04 (Precise). | |
# With minor modifications, this script *can also be used* on dedicated servers | |
# or any KVM- or XEN-based Virtual Private Server (VPS) from other providers. | |
# | |
# For detailed instructions, please see: | |
# https://blog.ls20.com/ipsec-l2tp-vpn-auto-setup-for-ubuntu-12-04-on-amazon-ec2/ | |
# Original post by Thomas Sarlandie: |
#!/usr/bin/env nodejs | |
// -*- mode: js -*- | |
/* | |
NodeJS: | |
WEB: https://nodejs.org/ | |
Package: https://www.npmjs.com/ | |
*/ |
#!/usr/bin/env fibjs | |
// -*- mode: js -*- | |
/* | |
Fibjs: | |
web: http://fibjs.org/ | |
Package: http://fpmjs.org/ | |
Install: | |
1. $ npm install fibjs |
<html> | |
<head> | |
<script type="text/javascript"> | |
// 使用方法: | |
// 页面加载完毕后,打开 浏览器控制台,调用函数 `get_file_content()` 即可以看到数据。 | |
function chr (code){ | |
return String.fromCharCode(parseInt(code)); | |
} | |
function ord(s){ | |
return s.charCodeAt(0); |
07/03 2016
daxue.qq.com/content/content/id/2578
"use strict"; | |
function primes_with_generator(start, max){ | |
// start: int ( start >= 2 ) | |
// max : int | |
if ( start < 2 ) throw new Error("start > 2 | start == 2"); | |
var generator = function* (start, max){ | |
var n = start || 2; | |
while ( n <= max ){ | |
yield n++; |
10/20 2016
官方资料: Create an Auto-Incrementing Sequence Field
Pymongo方法: update_one