2018-05-01


Been Done

  • Work: 8 hours
    • Resolve Popshop issue: throw 500 when there's no image for a product
  • Pairing Learning:
    • Stub vs Mock(Behavior-based vs State based.)

Thoughts

Pay attention on stack trace

when I pairing with Leander, I found I was not that pay attention on stack track which makes it hard for me to target on errors and I found that Leander is really focused on what been shown on stack trace and it easier for him to target that error, I need to try doing that as well.

Smile no matter what

When I felt stress and when I talking something serious, I will not smile and turn my serious/anger face in front of people which I can see it make the overall atmosphere bad. I need to practice smile and remember smile no matter what the situations are.


Learned

Git

  • made patch and apply patch

git diff head -p >> patch.diff #when code is staged
git apply ***.patch (git apply -h for more details)

Rails

  • how to assign url to asset image

ApplicationController.helper.asset_url

// find out if the first is null.if it is shows nothing.
product.product_images.first&.url

*  the benefit to Safe Navigation Operator in ruby
  * if product.product_images == nil. it would get => nil
  * if prodcut.prodcut_images doesn't have first method, it would throw an error instead. which is safer
* Also if use hash fetch, use Hash#dig instead
  > address = param[:account].fetch(:owner).fetch(:address)
  > = 
  > address = account.dig(:account, :owner, address)

get Port info from Mac

lsof -i tcp:3000

Stub vs Mock

Mock is what we are talking about here: object pre-programmed with expectations which form a specification of the calls they are expected to receive
stub provide canned answers to calls made during the test, usually not responding at all to anything outside what's programmed in for the test
stub verify state while mock verify behaviors

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末查吊,一起剝皮案震驚了整個濱河市衣形,隨后出現(xiàn)的幾起案子逢渔,更是在濱河造成了極大的恐慌递雀,老刑警劉巖,帶你破解...
    沈念sama閱讀 222,183評論 6 516
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件悲雳,死亡現(xiàn)場離奇詭異挎峦,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)合瓢,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,850評論 3 399
  • 文/潘曉璐 我一進(jìn)店門坦胶,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人晴楔,你說我怎么就攤上這事顿苇。” “怎么了税弃?”我有些...
    開封第一講書人閱讀 168,766評論 0 361
  • 文/不壞的土叔 我叫張陵纪岁,是天一觀的道長。 經(jīng)常有香客問我则果,道長幔翰,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 59,854評論 1 299
  • 正文 為了忘掉前任西壮,我火速辦了婚禮遗增,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘款青。我一直安慰自己做修,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,871評論 6 398
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著饰及,像睡著了一般蔗坯。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上燎含,一...
    開封第一講書人閱讀 52,457評論 1 311
  • 那天步悠,我揣著相機(jī)與錄音,去河邊找鬼瘫镇。 笑死,一個胖子當(dāng)著我的面吹牛答姥,可吹牛的內(nèi)容都是我干的铣除。 我是一名探鬼主播,決...
    沈念sama閱讀 40,999評論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼鹦付,長吁一口氣:“原來是場噩夢啊……” “哼尚粘!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起敲长,我...
    開封第一講書人閱讀 39,914評論 0 277
  • 序言:老撾萬榮一對情侶失蹤郎嫁,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后祈噪,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體泽铛,經(jīng)...
    沈念sama閱讀 46,465評論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,543評論 3 342
  • 正文 我和宋清朗相戀三年辑鲤,在試婚紗的時候發(fā)現(xiàn)自己被綠了盔腔。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 40,675評論 1 353
  • 序言:一個原本活蹦亂跳的男人離奇死亡月褥,死狀恐怖弛随,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情宁赤,我是刑警寧澤舀透,帶...
    沈念sama閱讀 36,354評論 5 351
  • 正文 年R本政府宣布,位于F島的核電站决左,受9級特大地震影響愕够,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜哆窿,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 42,029評論 3 335
  • 文/蒙蒙 一链烈、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧挚躯,春花似錦强衡、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,514評論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽感挥。三九已至,卻和暖如春越败,著一層夾襖步出監(jiān)牢的瞬間触幼,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,616評論 1 274
  • 我被黑心中介騙來泰國打工究飞, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留置谦,地道東北人。 一個月前我還...
    沈念sama閱讀 49,091評論 3 378
  • 正文 我出身青樓亿傅,卻偏偏與公主長得像媒峡,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子葵擎,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,685評論 2 360

推薦閱讀更多精彩內(nèi)容