node master&
node test&
# wait ~7 seconds
pkill -SIGINT -x test-server
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 | |
$node = menu_get_object(); | |
if (empty($node)) { | |
$node = node_load(arg(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
elliotttf@4kmba:~$ php /tmp/test.php | |
Notice: Undefined index: baz in /private/tmp/test.php on line 15 | |
Notice: Undefined index: baz in /private/tmp/test.php on line 16 |
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
name = Theme it Once Example | |
description = Example of sharing markup with a front-end and back-end template engine in Drupal. | |
core = 7.x |
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
# Bot factoid. | |
# | |
# facts - List all the stored definitions. | |
# <subject> is <definition> - Define a word or subject. | |
# forget <subject> - Remove a definition. | |
u = require 'underscore' | |
util = require 'util' | |
module.exports = (robot) -> |
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'; | |
/** | |
* @file master.js | |
* Master process code for adios-example. | |
*/ | |
const cluster = require('cluster'); | |
const os = require('os'); | |
const path = require('path'); |
I hereby claim:
- I am elliotttf on github.
- I am elliotttf (https://keybase.io/elliotttf) on keybase.
- I have a public key whose fingerprint is 44E1 73E2 CF8C F08C 87D6 7685 BCCE 227F C0D4 9E70
To claim this, I am signing this object:
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 { createBackgroundTransaction, endTransaction } = require('newrelic'); | |
const fs = require('fs'); | |
createBackgroundTransaction('fileProcessing', () => { | |
return new Promise((resolve, reject) => fs.readFile('/tmp/input.txt', (err, file) => { | |
if (err) { | |
return reject(err); | |
} |
Memoization is a technique for storing computed values in-memory. Essentially, it's a fancy name for in-memory cache.
Memoization is useful when you have potentially expensive or highly repetitive computations that need to be executed. Rather than re-running the computation on each iteration, your routine computes once and fetches already computed values from memory.
OlderNewer