Created
January 16, 2012 23:14
-
-
Save brikis98/1623528 to your computer and use it in GitHub Desktop.
Sample code for developer happiness blog post
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 app = express.createServer(); | |
| app.get('/', function(req, res){ | |
| res.send('Hello World'); | |
| }); | |
| app.listen(3000); |
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
| a, b, c, d = 1, 2, 3, 4 | |
| case year | |
| when 1970..1979: "Seventies" | |
| when 1980..1989: "Eighties" | |
| when 1990..1999: "Nineties" | |
| end | |
| today = Time.now | |
| yesterday = today.yesterday |
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
| puts "Hello World!" |
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 http = require('http'); | |
| http.createServer(function (request, response) { | |
| response.writeHead(200, {'Content-Type': 'text/plain'}); | |
| response.end('Hello World\n'); | |
| }).listen(8124); | |
| console.log('Server running at http://127.0.0.1:8124/'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment