- Make sure you have mongodb, gcc, python & nodejs installed
- Clone chimera-framework (
git clone git@github.com:goFrendiAsgard/chimera-framework.git
) - Go to chimera-framework directory (
cd chimera-framework
) - Perform
npm test
to make sure everything is working. - Perform
node --prof node_modules/mocha/bin/_mocha
- A profile log file will be produced. In my case, the name of the file is
isolate-0x2652d80-v8.log
. - Make a more readable log file by performing
node --prof-process isolate-0x2652d80-v8.log > profile.log
. - Open up
profile.log
with your favorite text editor
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
const request = require('request') | |
// ///////////////////////////////////////////////////////////////////// | |
// Callback mechanism | |
// ///////////////////////////////////////////////////////////////////// | |
request('http://localhost:3000/genres', function (error, response, body) { | |
if (error) { | |
return console.error(error) | |
} |
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
const request = require('request') | |
function add (n1, n2) { | |
return n1 + n2 | |
} | |
// ///////////////////////////////////////////////////////////////////// | |
// First Section | |
// ///////////////////////////////////////////////////////////////////// | |
console.log('before-add') // 1 |
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
// filename: server.js | |
// original source: https://www.codementor.io/codementorteam/nodejs-profiling-build-a-high-performance-app-babjg4jf9 | |
// generate profile: node --prof server.js | |
// make profile readable: node --prof-process isolate-0x101804a00-v8.log | |
'use strict' | |
const crypto = require('crypto') | |
function hash (password) { | |
const salt = crypto.randomBytes(128).toString('base64') | |
const hash = crypto.pbkdf2Sync(password, salt, 10000, 512, 'sha512') |
Type | Long | Not Long || Sweet | Not Sweet || Yellow |Not Yellow|Total
Banana | 400 | 100 || 350 | 150 || 450 | 50 | 500
Orange | 0 | 300 || 150 | 150 || 300 | 0 | 300
Other Fruit | 100 | 100 || 150 | 50 || 50 | 150 | 200
____________________________________________________________________
Total | 500 | 500 || 650 | 350 || 800 | 200 | 1000
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
<?php | |
/* | |
<td class="titleColumn"> | |
1. | |
<a href="/title/tt0111161/?pf_rd_m=A2FGELUUNOQJNL&pf_rd_p=2398042102&pf_rd_r=03C6KZNHFW3SPT6H7T55&pf_rd_s=center-1&pf_rd_t=15506&pf_rd_i=top&ref_=chttp_tt_1" title="Frank Darabont (dir.), Tim Robbins, Morgan Freeman">The Shawshank Redemption</a> | |
<span class="secondaryInfo">(1994)</span> | |
</td> | |
*/ | |
$pageSource = file_get_contents('http://www.imdb.com/chart/top'); | |
$matches = array(); |
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
package binarytreea; | |
class Node { | |
Node parent, left, right; | |
double data; | |
public Node(double newData) { | |
this.data = newData; | |
} | |
void setLeft(Node other) { | |
this.left = other; |
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
package binarytreeb; | |
class Node { | |
double data; | |
Node parent, left, right; | |
public Node(double newData) { | |
this.data = newData; | |
} | |
void setLeft(Node other) { | |
if (other == null) { |