看了《學徒模式》一書後,凍仁試著用 Gist 管理自己的待讀書單,並不時修改其閱讀順序。您可以在 revisions 找到編修記錄。
目錄:
function rgbToXyz(r, g, b) { | |
r /= 255 | |
g /= 255 | |
b /= 255 | |
if (r > 0.04045) r = Math.pow(((r + 0.055) / 1.055), 2.4) | |
else r = r / 12.92 | |
if (g > 0.04045) g = Math.pow(((g + 0.055) / 1.055), 2.4) | |
else g = g / 12.92 |
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
class Controller | |
include LazyLoad | |
def show | |
@model = Model.find(...) | |
respond_to do |format| | |
format.html do | |
@html_specific_data = Model.find(...) | |
end |
# Optimized for writes, sort on read | |
# LVC | |
redis.hset("bonds|1", "bid_price", 96.01) | |
redis.hset("bonds|1", "ask_price", 97.53) | |
redis.hset("bonds|2", "bid_price", 95.50) | |
redis.hset("bonds|2", "ask_price", 98.25) | |
redis.sadd("bond_ids", 1) | |
redis.sadd("bond_ids", 2) |
.searchtext { COLOR: #FFFFFF; FONT: 12px arial, verdana, sans-serif; font-weight: normal; } | |
.searchsitebox { | |
FONT: 12px arial, verdana, sans-serif; | |
color: #000000; | |
background-color: #FFFFFF; | |
background-image: url("../images/YourCustomBackgroundBarImage.gif"); | |
WIDTH: 120PX; | |
HEIGHT: 19PX; | |
BORDER: #000000 1px solid; | |
margin-top: 1px; |