超雑にまとめました。修正してください。
登場人物
- アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
- 後輩: 頼んでばっかしで役に立たない。
- サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
- プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
p.a.b.c.d.e.f.g.h.i.j.k { | |
color: red; | |
} | |
p#a { | |
color: blue; |
class Class | |
def new_type(&block) | |
new_class = self.dup | |
new_class.class_eval(&block) if block_given? | |
new_class | |
end | |
end | |
CArray = Array.new_type do | |
def example |
jQuery.fn.extend({ | |
/** | |
* $('li').tapp() で console.debug に this を出力します。 | |
* | |
* func を与えることで、func(this) を実行した結果を console.debug に出力します。 | |
* | |
* @this {jQuery} | |
* @param {function(jQuery)=} func | |
* @return {jQuery} | |
*/ |
FactoryGirl.define do | |
factory :user do | |
tasks do |user| | |
[ | |
FactoryGirl.create(:task, user: user) | |
] | |
end | |
end | |
end |
# 記事クラス | |
class Article < AR::Base | |
belongs_to :user | |
end |
require 'unextend' | |
class Person | |
attr_accessor :husbund, :wife | |
def help(other) | |
... | |
end | |
def tell_love(other) |
# 役者クラス | |
# | |
# say: 役者は声を発する事ができる。 | |
class Actor | |
def say(words) | |
puts words | |
end | |
end |
class A | |
def say | |
puts "A" | |
end | |
end | |
module B | |
def self.role(klass, &block) | |
ref = refine(klass) { } | |
ref.module_eval(&block) |
package main | |
import ( | |
"fmt" | |
) | |
type User struct { | |
Name string | |
} |