View client.js
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 net = require('net'); | |
// send message to server (forked process) | |
process.send({ | |
event: 'spawned', | |
data: { | |
client: 'is loading' | |
} | |
}); |
View fizzBuzzNoIf.php
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 | |
$result = array_diff( range( 0, 100, 1 ), range( 0, 100, 3 ), range( 0, 100, 5 ) ) + | |
array_fill_keys( range( 0, 100, 15 ), 'FizzBuzz' ) + | |
array_fill_keys( range( 0, 100, 5 ), 'Buzz' ) + | |
array_fill_keys( range( 0, 100, 3 ), 'Fizz' ); | |
ksort( $result ); | |
unset( $result[ 0 ] ); | |
echo implode( "\n", $result ); |
View fizBuzzRegex.php
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 | |
$result = ''; | |
for($i=1;$i<=100;$i++){ | |
if(!($i%3)){ | |
$result .= 'm'; | |
} | |
$result .= $i . "\n"; | |
} | |
$result = preg_replace("/m\d*(0|5)\n/", "FizzBuzz\n", $result); | |
$result = preg_replace("/\d*(0|5)\n/", "Buzz\n", $result); |