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
[ '0.0.0.0', | |
'::', | |
'::1', | |
'127.0.0.1', | |
'fe80::1%lo0', | |
'192.168.1.7' ] |
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 net = require('net'); | |
var os = require('os'); | |
function getLocalHosts() { | |
var hosts = ['0.0.0.0', '::']; | |
var interfaces = os.networkInterfaces(); | |
Object.keys(interfaces).forEach(function(interfaceName) { | |
var interface = interfaces[interfaceName]; | |
interface.forEach(function(info) { | |
var address = info.address; |
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 <iostream> | |
#define ENUM_CLASS(Name, ...) \ | |
struct Name { \ | |
static int sCounter; \ | |
int mValue; \ | |
Name() : mValue(++Name::sCounter) {} \ | |
operator int() { return mValue; } \ | |
static Name __VA_ARGS__; \ | |
}; \ |
OlderNewer