This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one
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
#https://groups.google.com/forum/#!topic/rubykr/9iEhvPdaoq4 | |
<%= form_tag("/search/result", :method => "get") do %> | |
<%= select("search", "grade_id", @grades.map { |g| ["#{g.grade }", g.id] }, { :include_blank => true }) %> | |
<%= select("search", "sex_id", @sexes.map { |x| ["#{x.sex }", x.id] }, { :include_blank => true }) %> | |
<%= select("search", "subject_id", @subjects.map { |s| ["#{s.subject}", s.id] }, { :include_blank => true }) %> | |
<%= submit_tag("Search") %> | |
<% end %> |
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
var express = require('express') | |
, path = require('path'); | |
process.on('uncaughtException', function (err) { | |
console.log('uncaught exception:--------------------------------------------- ' ); | |
console.log( err + err.stack); | |
}); | |
mainServer = module.exports = express.createServer(); | |
mainServer.set('path', __dirname); |
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
var app = require('../app'); | |
console.log(); | |
app.routes.all().forEach(function(route){ | |
console.log(' \033[90m%s \033[36m%s\033[0m', route.method.toUpperCase(), route.path); | |
}); | |
console.log(); | |
process.exit(); |
Some exercises from the Falsy Values workshops.
The good parts:
- HTTP server and client in same script
- Express cookies example
- Express routing example
- Express error handling
- Express middlewares example
- Simple HTTP proxy
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
vows = require 'vows' | |
assert = require 'assert' | |
tobi = require 'tobi' | |
vows.describe('Root').addBatch | |
'브라우저에서': | |
topic: -> tobi.createBrowser 3000, 'localhost' | |
'GET /의': | |
topic: (topic) -> | |
topic.get "/", @callback.bind(@, null) |
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
require 'test/unit' | |
require 'rubygems' | |
gem 'activesupport' | |
require 'active_support/core_ext/module' | |
class Original | |
def hello | |
"Original" | |
end | |
end |
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
vows = require 'vows' | |
assert = require 'assert' | |
#Document = require('../../models/document') | |
## model ## | |
mongoose = require 'mongoose' | |
Schema = mongoose.Schema | |
ObjectId = Schema.ObjectId | |
db = mongoose.connect 'mongodb://localhost:27017/notepad' | |
DocumentSchema = new Schema |
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
#ruby-1.9.2-p290 | |
e = [*1..9].each # => #<Enumerator: [1, 2, 3, 4, 5, 6, 7, 8, 9]:each> | |
e.next # => 1 | |
e.next # => 2 | |
e.rewind # => #<Enumerator: [1, 2, 3, 4, 5, 6, 7, 8, 9]:each> | |
e.next # => 1 |