Skip to content

Instantly share code, notes, and snippets.

View run26kimo's full-sized avatar
👋
Hello ~

RichKe run26kimo

👋
Hello ~
  • Taipei, Taiwan
View GitHub Profile
@chusiang
chusiang / myToReadBookLists.md
Last active March 27, 2024 08:49
凍仁的讀書清單

凍仁的讀書清單

Migrated to GitLab and GitHub.

看了《學徒模式》一書後,凍仁試著用 Gist 管理自己的待讀書單,並不時修改其閱讀順序。您可以在 revisions 找到編修記錄。

目錄:

  1. 待讀書單
  2. 已讀書單
@kfitfk
kfitfk / rgb_to_lab.js
Created March 18, 2016 07:17
Convert RGB color to CIE LAB color
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
@SabretWoW
SabretWoW / rspec_model_testing_template.rb
Last active March 7, 2024 03:56
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# 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:
@joakimk
joakimk / controller.rb
Created February 17, 2012 10:40
A way to lazy load partials in Rails 3
class Controller
include LazyLoad
def show
@model = Model.find(...)
respond_to do |format|
format.html do
@html_specific_data = Model.find(...)
end
@jacqui
jacqui / gist:983051
Created May 20, 2011 14:43 — forked from pauldix/gist:981916
Redis SORT command examples
# 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)
anonymous
anonymous / default.css
Created December 30, 2009 17:58
.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;