Skip to content

Instantly share code, notes, and snippets.

@ghoseb
ghoseb / factorial.py
Created Nov 14, 2008
The evolution of a Python Programmer
View factorial.py
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
@laterbreh
laterbreh / Express 4 and Socket.io: Passing socket.io to routes - app.js
Last active Oct 15, 2020
Express 4 and Socket.io: Passing socket.io to routes.
View Express 4 and Socket.io: Passing socket.io to routes - app.js
var app = express();
app.io = require('socket.io')();
var routes = require('./routes/index')(app.io);
app.use('/', routes);
You can’t perform that action at this time.