- node.js
- Installation paths: use one of these techniques to install node and npm without having to sudo.
- Node.js HOWTO: Install Node+NPM as user (not root) under Unix OSes
- Felix's Node.js Guide
- Creating a REST API using Node.js, Express, and MongoDB
- Node Cellar Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB
- JavaScript Event Loop
- Node.js for PHP programmers
This file contains 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
$KCODE = 'u' | |
# Goal: 小写金额转换为大写金额 | |
# Limit: 金额整数位支持到亿位,小数点后支持两位并且不支持四舍五入 | |
class ChineseFee | |
attr_reader :chn_numbers, :chn_units, :chn_decimals | |
def initialize | |
@chn_numbers = %w(零 壹 贰 叁 肆 伍 陆 柒 捌 玖) | |
@chn_units = %w(元 拾 佰 仟 万 拾万 佰万 仟万 亿) |
This file contains 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
def triangle(a, b, c) | |
if a == 0 || b == 0 || c == 0 | |
raise TriangleError | |
end | |
if((a+b < c) || (a+c < b) || (b+c < a)) | |
raise TriangleError | |
end | |
if a == b && b == c # && a == c | |
:equilateral | |
elsif a == b || b == c || c == a |
This file contains 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
def triangle(a, b, c) | |
raise TriangleError if [a,b,c].min <= 0 | |
x, y, z = [a,b,c].sort | |
raise TriangleError if x + y <= z | |
[:equilateral,:isosceles,:scalene].fetch([a,b,c].uniq.size - 1) | |
end |
This file contains 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
# https://coreos.com/docs/running-coreos/platforms/openstack/ | |
Step one: | |
``` | |
$ wget http://alpha.release.core-os.net/amd64-usr/current/coreos_production_openstack_image.img.bz2 | |
$ bunzip2 coreos_production_openstack_image.img.bz2 | |
$ glance image-create --name CoreOS \ | |
--container-format bare \ | |
--disk-format qcow2 \ |
This file contains 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
# 下载测试包 | |
git clone https://github.com/brownsys/zookeeper-benchmark.git | |
# build bench tools | |
mvn -DZooKeeperVersion=3.4.6 package | |
# run benchmark | |
java -cp target/lib/*:target/* edu.brown.cs.zkbenchmark.ZooKeeperBenchmark --conf benchmark.conf |
This file contains 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
#!/bin/sh | |
############################################## | |
data_paths=/srv/dockerdata/debuild:/build # | |
data_name=debdata # | |
data_image=user/debdata # | |
bridge=br0 # | |
ipfile=/etc/default/docker_ips # | |
############################################## |
###RUN SPARK ON 数人云
###单机版
- Mesos运行在host上
- Spark driver 和 executor运行docker上
#####1.搭建Mesos集群环境 详情 ,登录数人云,登录控制台后,通过集群管理创建自己的集群 #####2.运行Spark demo
This file contains 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
upstream tumblr { | |
server 72.32.231.8:80; | |
} | |
server { | |
listen 80; | |
server_name jyorr.com; | |
access_log /var/log/nginx/jyorr.access.log; |