I live in Manhattan.
Email me: moonmaster9000@gmail.com
Call me: 347.583.9602
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
| def my_reverse( a ) | |
| #... fill in this code | |
| end | |
| a = [1,2,3,4] | |
| b = my_reverse a | |
| puts b.inspect | |
| #==> [4, 3, 2, 1] |
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
| class Array | |
| def make_flat | |
| flat_array = [] | |
| self.each do |element| | |
| if element.respond_to? :make_flat | |
| flat_array += element.make_flat | |
| else | |
| flat_array << element | |
| end | |
| end |
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
| (function() { | |
| var HomeController, app, routes; | |
| HomeController = { | |
| index: function() { | |
| return $('#main').text('Welcome!'); | |
| } | |
| }; | |
| routes = function() { | |
| return this.get('#/', HomeController.index); | |
| }; |
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
| db.events.save({name: "event1", start_date: "2010/01/01", end_date: "2010/09/01"}) | |
| db.events.save({name: "event2", start_date: "2010/01/01", end_date: "2010/09/30"}) | |
| db.events.find({start_date: {'$lte': "2010/09/10"}, end_date: {'$gt': "2010/09/10"}}) |
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
| HomeController = | |
| index: -> $('#main').text 'Welcome!' | |
| routes = -> @get '#/', HomeController.index | |
| app = $.sammy routes | |
| $ -> app.run() |
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
| app = require('express').createServer() | |
| app.get( | |
| '/', | |
| (req, res) -> | |
| res.send('hello express in coffeescript!') | |
| ) | |
| 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
| -- blog posts admin actions | |
| get ["admin", "posts"] = do .... | |
| post ["admin", "posts"] = do .... | |
| put ["admin", "posts", id] = do .... | |
| delete ["admin", "posts", id] = do .... | |
| -- blog frontend | |
| get ["posts"] = do .... | |
| get ["posts", year, month, day] = do .... | |
| get ["posts", year, month, day, id] = do .... |
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
| sayHello "spanish" = "hola" | |
| sayGoodBye "spanish" = "hasta la vista" | |
| sayHello "english" = "hi" | |
| sayGoodBye "english" = "laterz" |
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
| sayHello "spanish" = "hola" | |
| sayHello "english" = "hi" | |
| sayGoodBye "spanish" = "hasta la vista" | |
| sayGoodBye "english" = "laterz" |