- Clone this gist to a local folder
- Run
npm install
in the local folder
- Launch the server:
node index.js
- Launch the server with cluster feature:
/** | |
* Parse the UTF8 ".ini" file via the Boost property_tree | |
*/ | |
#include <string> | |
#include <fstream> | |
#if defined(__APPLE__) | |
# include <codecvt> | |
#endif /* defined(__APPLE__) */ |
#REQUIRES -Version 3.0 | |
# This is a simple sample for access the MS UIAutomation in PowerShell. | |
# In this sample: | |
# 1. Load the MS UIA via System.Reflection.Assembly | |
# 2. Launch the AUT ( calc.exe ) | |
# 3. Find the AutomationElement via the AUT Process Id | |
# 4. Find buttons via 'ClassName' and 'Name' property | |
# 5. Click the '1', '+', '1', '=' buttons. | |
# At last, we will get '2' in the result of calc App. |
{ | |
"curly": true, | |
"eqeqeq": true, | |
"immed": true, | |
"latedef": true, | |
"newcap": true, | |
"noarg": true, | |
"sub": true, | |
"undef": true, | |
"unused": "vars", |
/* Dump the NODE V8 heap to a file | |
* Usage: | |
* 1. Install the node-heapdump: npm install node-heapdump | |
* 2. call below code when you need dump the heap. | |
* require('./dump.js')('test'); | |
*/ | |
'use strict'; | |
var path = require('path'), | |
util = require('util'); |
/* async test - It's a bad .JS. Don't use this scenario in a real server. | |
* 1. The function1 saved the 'callback' and call it when the 'connect' is emitted | |
* 2. The function3 will be triggered again when the connect event happended. | |
*/ | |
'use strict'; | |
var events = require("events"), | |
servEvt = new events.EventEmitter(); | |
/** | |
* Tests for singly linked list | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stddef.h> | |
#include <assert.h> | |
/* singly link list node */ |
/** | |
* Parse the "argv" via the Boost.program_options | |
* (get the number, string and array from command line) | |
*/ | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <boost/program_options.hpp> |
#!/usr/bin/env python | |
import sys, os | |
# The test function for VIM plugin | |
def my_test(vim, vim_ver): | |
buf = vim.current.buffer | |
# append process id & python version info to the buffer | |
buf.append("VIM process %d; vim version: %s\n" % (os.getpid(), vim_ver)) | |
buf.append("Py version: %s\n" % sys.version_info) |