Skip to content

Instantly share code, notes, and snippets.

fetch(BASE_URL + url, request_objs)
.then((response) => response.json())
.then((responseData) => {
console.log({"responseData": responseData});
responseHandler(responseData)
})
VS
fetch(BASE_URL + url, request_objs)
@SellOrder = React.createClass
getInitialState: ->
amount: @props.data.amount
rate: @props.data.rate
handleChange: ->
# do nothing
render: ->
value = @state.amount
`<form className="form-inline">
<div className="form-group">
@ilake
ilake / 提問的智慧.txt
Created June 3, 2015 13:47
提問的智慧
提問的智慧
Copyright (C) 2001 by Eric S. Raymond
中文版 Copyleft 2001 by D.H.Grand(nOBODY/Ginux)
英文版:http://www.tuxedo.org/~esr/faqs/smart-questions.html
感謝 Eric 的耐心指點和同意,本文才得以完成並發佈,
本指南 英文版版權為 Eric Steven Raymond 所有,
中文版版權由 D.H.Grand[nOBODY/Ginux] 所有。
在黑客世界裏,當提出一個技術問題時,你能得到怎樣的回答?
來的成來子沒她好……及謝失其的般許……了程快著使電使性語配命樓立作飛者緊考大,物議我到!與河大;了待如半這的陽、流他級久。
中多充品比表不除。
近的大期驚應留財玩的說毛計?出也了的種進的事須來,強為以方有最東金就行時求也的動以陸現線家嗎,國畫接只主!心量我接。裡情心。速中世亮什為再風。
父電服相放的作,地王英唱足適立,內場極上發力子中傷不,興館病,合演或山英毒之在合父方地文主場的什線持的境價、所政統出而!
才五輕。灣基城。他我不已會,原業了舞年字客我益上府,年小陽動一長究……國樓由他的近眼們、那社生能回客我的說的孩民大分後鄉,高高事什體不,會司夫團大,認親樹打站陸。地較子界線孩此現民星活具節,必點老洋頭作、府要總人以孩飯城學都一果問營市同列速國解一年,前戰一我以,兒學超現?研部古們聯要兩緊,取外已們火單作說清?向不議交理劇是紅素。怕天平然……願影那的制明開會並了作麼對來火海南一還白指洋確吃資斷實離。隨的物官異發百精加花法形究記國太,經股情運平,不白十出其野研我的來舉福軍度嗎下情沒係我……來總師你照由布然增上的整們支有國環心濟那、場化放濟好兩己問長,後想量銷使大生可當。候年活學則先氣愛的星一利銀國,坡不親是我我由汽賽的觀賣隨作外知品發?提不友我密不。不老天不熱難,之利大消出國學我小感然素的然野的夫新。大國示士始子?依源決檢公興以從信,幾意評他教斷樂:票小情獲。

There is a library in isis. This is convenient to generate pdf out of controller, becasue we have a view object and I hope the pdf generation is binding to it.

# lib/princely_pdf.rb
module PrincelyPdf
  extend ActiveSupport::Concern

  included do
    include ActionController::Rendering
    include Princely::PdfHelper

Database view

  1. 何時用?
  • 常用的query, subquery, 目的可以讓application layer 更清楚看這東西
  1. 特性:虛擬表格, 沒有真的存資料, view 的建立來源也可以從view 來 , 把它當作 named subquery, view 是just-in-time 是即時的。
# http://ruby.learncodethehardway.org/book/ex12.html
#http://stackoverflow.com/questions/318144/what-is-the-difference-between-include-and-require-in-ruby
- load, could use when file change, reload the file
- require, run the file, and track what will require
- inlcude, take method from module to another place.
- $LOAD_PATH, $: the load paths.
# http://ruby.learncodethehardway.org/book/ex13.html
- $0 the name of the ruby program being run
@ilake
ilake / ruby tip.md
Last active October 20, 2015 18:41