$ echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf
$ echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -w kern.maxfiles=65536
$ sudo sysctl -w kern.maxfilesperproc=65536
$ ulimit -n 65536
View README.md
View index.ts
interface User { | |
username: string; | |
roles: string[]; | |
} | |
interface Role { | |
name: string; | |
desc: string; | |
permission: Permission[]; | |
} |
View index.js
const babylon = require("babylon"); | |
const types = require("babel-types"); | |
const visitors = { | |
File(node, scope) { | |
evaluate(node.program, scope); | |
}, | |
Program(program, scope) { | |
for (const node of program.body) { | |
evaluate(node, scope); |
View main.go
package main | |
import ( | |
"net/http" | |
"log" | |
"io/ioutil" | |
"encoding/json" | |
"bytes" | |
"strings" | |
) |
View README.md
构建一个可用的内存缓存.
View supershell.js
const { spawn, exec } = require('child_process'); | |
const COMMAND = Symbol('command'); | |
class Shell { | |
constructor(command) { | |
this[COMMAND] = [command]; | |
} | |
} | |
const run = new Proxy( |
View cycle.js
class Node { | |
constructor(prev, value, next) { | |
this.prev = prev; | |
this.next = next; | |
this.value = value; | |
} | |
} | |
const CURRENT_INDEX = Symbol('current index in cycle'); | |
const ROUND_INDEX = Symbol('how many round in cycle'); |
View pool.go
package pool | |
type CreatorFunc func() (interface{}, error) | |
type DestroyerFunc func(resource interface{}) (interface{}, error) | |
type Pool struct { | |
config Config | |
options Options | |
pool []interface{} | |
} |
View emitter.go
package pool | |
import "time" | |
type Event struct { | |
Time time.Time | |
Name string | |
Data interface{} | |
Id string | |
} |
View hs.js
/** | |
* Generate a New status | |
* @param code | |
* @param message | |
* @constructor | |
*/ | |
function Status(code, message) { | |
this.code = code; | |
this.message = message; | |
} |
NewerOlder