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
#include <errno.h> | |
#include <libgen.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/stat.h> | |
int mkdir_p(char* path) { | |
int len = strlen(path); | |
if (len == 0) { |
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
"use strict"; | |
const mysql2 = require('mysql2'), | |
co = require('co'); | |
const pool = mysql2.createPoolPromise({ | |
host: "127.0.0.1", | |
port: 3306, | |
user: 'root', | |
password: "", |
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
var Redis = require('ioredis'), | |
merge = require('utils-merge'), | |
_ = require('lodash'), | |
os = require('os'), | |
net = require('net'), | |
util = require('util'), | |
EventEmitter = require('events').EventEmitter; | |
/** |
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
var Redis = require('ioredis'), | |
utils = require('ioredis/lib/utils'), | |
_ = require('lodash'), | |
net = require('net'), | |
assert = require('assert'); | |
/** | |
* A SentinelConnector.prototype.resolveSlave replacement, prefer local slave. | |
* |
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
var co = require('co'), | |
assert = require('assert'); | |
fs = require('fs'), | |
readline = require('readline'); | |
module.exports = function (filename) { | |
var instance = { | |
lines: [], | |
closed: false, |
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
var fs = require('fs'), | |
express = require('express'), | |
app = express(); | |
function deleteFile (file) { | |
fs.unlink(file, function (err) { | |
if (err) { | |
console.error(err.toString()); | |
} else { | |
console.warn(file + ' deleted'); |