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
return [ | |
'actor', | |
'director', | |
'writer', | |
'producer' | |
].reduce(function (persons, role) { | |
var list = movie[role+'s'].list; | |
var newPersons = list.map((person) => { | |
return { |
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 strict'; | |
var pattern = new Buffer([0xF0, 0x9F, 0x92, 0x95]); | |
var data = new Buffer(8000); | |
for (var i = 0; i < 8000; i += 4) { | |
pattern.copy(data, i, 0, 4); | |
} | |
data.slice(0, 7833).toString(); |
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
PID 24572 received SIGSEGV for address: 0xc295000 | |
/home/myndzi/kefir-scrape/node_modules/segfault-handler/build/Release/segfault-handler.node(+0xd14)[0xb773dd14] | |
[0xb774340c] | |
node(_ZN7unibrow15Utf8DecoderBase14WriteUtf16SlowEPKhPtj+0x49)[0x86f8d39] | |
node(_ZN2v88internal7Factory17NewStringFromUtf8ENS0_6VectorIKcEENS0_13PretenureFlagE+0x1d2)[0x84b2172] | |
node(_ZN2v86String11NewFromUtf8EPNS_7IsolateEPKcNS0_13NewStringTypeEi+0xa5)[0x83b6105] | |
node(_ZN4node11StringBytes6EncodeEPN2v87IsolateEPKcjNS_8encodingE+0x2c8)[0x87eb758] | |
node(_ZN4node6Buffer9Utf8SliceERKN2v820FunctionCallbackInfoINS1_5ValueEEE+0xfe)[0x87b839e] | |
node(_ZN2v88internal25FunctionCallbackArguments4CallEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEE+0x79)[0x83c6f69] | |
node[0x83e7a74] |
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 strict'; | |
var Promise = require('bluebird'); | |
var Connection = require('tedious').Connection ; | |
var Request = require('tedious').Request ; | |
var config = { | |
server: '152.16.26.58', | |
userName: 'sa', |
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
// controller | |
exports.likePost = function (req, res) { | |
// validate the input | |
req.checkBody('post_id', 'Post id is required').notEmpty(); | |
req.checkBody('post_id', 'Post id is needs to be an integer').isInt(); | |
req.checkBody('post_username', 'Post username is required').notEmpty(); | |
req.checkBody('like_username', 'Like username is required').notEmpty(); | |
var errors = req.validationErrors(); |
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 strict'; | |
var Transform = require('stream').Transform, | |
inherits = require('util').inherits, | |
fs = require('fs'); | |
function ConcatStream() { | |
Transform.call(this, { | |
writableObjectMode: true | |
}); |
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 strict'; | |
var arr = [ ]; | |
for (var i = 0; i < 100000; i++) { | |
arr.push(i); | |
} | |
console.log(arr); | |
process.exit(); | |
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
{#data} | |
<li><a href="{url}">{item}</a></li> | |
{/data} | |
<% data.forEach(function (i) { -%> | |
<li><a href="<%=url%>"><%=item%></a></li> | |
<% }); -%> |
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
Service.prototype.selectArray = function (query, column, asName) { | |
var formatter = new query.client.Formatter(); | |
var fromStr = this.table + '.' + this.pkey; | |
var q = knex.select(column) | |
.from(this.table) | |
.whereRaw(formatter.wrap(this.idName) + ' = ' + formatter.wrap(fromStr)); | |
return query.select( knex.raw(q).wrap('ARRAY(', ') AS ' + formatter.wrap(asName)) ); | |
}; |
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
[kris.re@krisre ~]$ python test.py | |
None | |
<_sre.SRE_Match object at 0x7fa97562a238> | |
<_sre.SRE_Match object at 0x7fa97562a238> | |
<_sre.SRE_Match object at 0x7fa97562a238> |