Skip to content

Instantly share code, notes, and snippets.

View marocchino's full-sized avatar
🏠
Working from home (7am~16pm JST)

marocchino

🏠
Working from home (7am~16pm JST)
View GitHub Profile
#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 %>

Header 1

Header 2

Header 3 ### (Hashes on right are optional)

Header 4

Header 5

Markdown plus h2 with a custom ID ## {#id-goes-here}

Link back to H2

This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one

@marocchino
marocchino / app.js
Created November 19, 2011 10:55 — forked from ppcano/app.js
Express Boostrapping
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);
@marocchino
marocchino / routes.js
Created November 19, 2011 10:52 — forked from mcotton/routes.js
Express routes
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();
@marocchino
marocchino / README.md
Created November 19, 2011 10:33 — forked from bergie/README.md
Falsy Values tutorials
@marocchino
marocchino / gist:1370395
Created November 16, 2011 15:41 — forked from yepp4you/gist:1369990
아아 이 어색함을 어쩔꼬 -_-);
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)
@marocchino
marocchino / gist:1370343
Created November 16, 2011 15:26 — forked from codian/gist:1369486
alias_method_chain quiz
require 'test/unit'
require 'rubygems'
gem 'activesupport'
require 'active_support/core_ext/module'
class Original
def hello
"Original"
end
end
@marocchino
marocchino / gist:1363961
Created November 14, 2011 13:34
왜 통과를 못할까? 뭔가 잘못했나?;;
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
#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