echo "\$ModLoad imudp" > /etc/rsyslog.d/server.conf
echo "\$UDPServerRun 514" >> /etc/rsyslog.d/server.conf
echo "\$ModLoad imtcp" >> /etc/rsyslog.d/server.conf
echo "\$InputTCPServerRun 514" >> /etc/rsyslog.d/server.conf
echo "\$PreserveFQDN on" >> /etc/rsyslog.d/server.conf
yum -y install rsyslog-gnutls rsyslog-mysql rsyslog-crypto
This file contains hidden or 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
Doxbee sequential | |
benchmarking ./doxbee-sequential/async-bluebird.js | |
{"time":428,"mem":60.38671875,"errors":0,"lastErr":null} | |
benchmarking ./doxbee-sequential/async-es2017-native.js | |
{"time":591,"mem":98.82421875,"errors":0,"lastErr":null} | |
benchmarking ./doxbee-sequential/async-es2017-util.promisify.js | |
{"time":479,"mem":69.7734375,"errors":0,"lastErr":null} | |
benchmarking ./doxbee-sequential/callbacks-baseline.js | |
{"time":149,"mem":29.99609375,"errors":0,"lastErr":null} |
This file contains hidden or 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 express = require('express'); | |
var router = express.Router(); | |
router.use('/playlists', require('./playlists')); | |
router.use('/songs', require('./songs')); | |
module.exports = router; |
This file contains hidden or 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
""" | |
Convert a MongoDB ObjectID to a version-1 UUID. | |
Python 2.7+ required for datetime.timedelta.total_seconds(). | |
ObjectID: | |
- UNIX timestamp (32 bits) | |
- Machine identifier (24 bits) | |
- Process ID (16 bits) | |
- Counter (24 bits) |
This file contains hidden or 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 5.012; | |
# | |
# Regexp for a unicode string JSON | |
# (the BOM and decoding must have been processed before) | |
# This means that with PCRE (used for example in PHP), the input must | |
# have been converted to UTF-8 and the '/u' flag must be given | |
# | |
my $json_regex = | |
qr/ |
This file contains hidden or 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
<?php | |
/** | |
* A more general PHP two-phase commit implementation. | |
* | |
* This assumes that we run on 5.3 or later. | |
*/ | |
class TransactionException extends Exception {} | |
/** |
This file contains hidden or 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
<?php | |
/** | |
* Simple two-phase commit for PHP couchbase. | |
* | |
* Michael Nitschinger (@daschl, 2012) | |
* | |
* Additional Remarks | |
* ------------------ | |
* - The Couchbase extension makes it currently pretty hard to write easy readable code when dealing with | |
* CAS (compared to the ruby adapter). This could certainly be improved with closures. I also found that |
This file contains hidden or 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
/** | |
* The sample usage of ECMA 5 Mozilla Features Implemented in V8 | |
* https://github.com/joyent/node/wiki/ECMA-5-Mozilla-Features-Implemented-in-V8 | |
* You can use thease new feature of ECMA5 on Node.js as you like. | |
* because there is no IE :) | |
* Order is deferent form original wiki. | |
* Sources are Checked on Node.js v0.5.0(unstable), v0.4.9(stable) | |
* | |
* you can execute this file. | |
* $ node ecma5_on_v8.js |
This file contains hidden or 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 win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
/** | |
* Adds "swipe" event support to Android, and adds swipe up and down to iOS. | |
* @param view The view that should be made swipeable. | |
* @param allowVertical Whether or not vertical swipes (up and down) are allowed; default is false. | |
* @param tolerance How much further you need to go in a particular direction before swipe is fired; default is 2. | |
*/ | |
function makeSwipeable(view, allowVertical, tolerance) { | |
tolerance = tolerance || 2; |