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
(Legend: [Slide title | point 1 / point 2...]) | |
[Multiplayer Pong | Rapid Web App Development] | |
Hello everyone. | |
My name is Daniel Chcouri. | |
... | |
I'll present to you a little multiplayer game, which I've developed as a showcase for rapid web app development, with a very cool stack that includes Node.js, Express and Socket.IO. |
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 tls = require('tls'); | |
var fs = require('fs'); | |
var jspack = require('jspack').jspack; | |
var options = { | |
key: fs.readFileSync('test-key.pem'), | |
cert: fs.readFileSync('test-cert.pem'), | |
// This is necessary only if the client uses the self-signed certificate. | |
//ca: [ fs.readFileSync('client-cert.pem') ] |
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
Developing Multiplayer Pong - with node.js, express and socket.io + Pong Tournament | |
The lecture takes about 45 minutes. | |
In the lecture I'll demonstrate a Pong game in which the audience smart phones will be used as remote controllers for a game arena that will be displayed in a main screen. | |
I'll talk briefly about the stack I used to develop the game and go over interesting parts of the code. | |
In the end of the lecture the audeince will be invited to join a Pong tournament. In each stage the players will be splitted into two teams randomly. The players of the winning team will stay in the tournament and will be splitted again until we'll have a winner. |
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
description "Redis Server" | |
start on local-filesystems | |
stop on shutdown | |
exec sudo -u redis /usr/bin/redis-server /etc/redis/redis.conf | |
respawn | |
respawn limit 10 5 |
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 tls = require('tls'); | |
var fs = require('fs'); | |
var jspack = require('jspack').jspack; | |
String.prototype.repeat = function(num) { | |
return new Array(num + 1).join( this ); | |
} | |
var options = { | |
key: fs.readFileSync('test-key.pem'), |
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 tls = require('tls'); | |
var fs = require('fs'); | |
var options = { | |
key: fs.readFileSync('test-key.pem'), | |
cert: fs.readFileSync('test-cert.pem'), | |
// This is necessary only if using the client certificate authentication. | |
requestCert: 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
# launch with: $ screen -c redis.screenrc | |
screen -t server 0 bash -c 'echo "Launching redis server"; redis-server; bash' | |
split | |
focus | |
screen -t redis-commander 1 bash -c 'redis-commander; bash' |
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 | |
function sendMessageViaApplePush($apns_environment, $certificate, $pushToken, $messageText) { | |
if ($apns_environment == "development") { | |
$serverURL = 'gateway.sandbox.push.apple.com:2195'; | |
} else { | |
$serverURL = 'gateway.push.apple.com:2195'; | |
} | |
$ctx = stream_context_create(); | |
stream_context_set_option($ctx, 'ssl', 'local_cert', $certificate); |
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 _ = require("underscore"); | |
var array_size = 4; | |
var iterations = 200000000; | |
var get_array = function () { | |
var a = []; | |
for (var i = 0; i < array_size; i++) { | |
a.push(i); |
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 _ = require("underscore"); | |
var percent = function (i) { | |
return i / 100; | |
} | |
var pensionSumCalculator = function (params) { | |
var default_params = { | |
current_savings_in_pensions_funds: 0, |