Skip to content

Instantly share code, notes, and snippets.

View kevinluo201's full-sized avatar

Kevin Luo kevinluo201

View GitHub Profile
@kevinluo201
kevinluo201 / rails_http_code.md
Last active August 30, 2021 16:41
Rails HTTP Code, Symbol Mapping
@kevinluo201
kevinluo201 / nginx.conf
Created December 2, 2018 16:02
nginx.conf with passenger and php fastcgi
http {
passenger_root /home/apps/.rvm/gems/ruby-2.3.7/gems/passenger-5.3.7;
passenger_ruby /home/apps/.rvm/gems/ruby-2.3.7/wrappers/ruby;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
@kevinluo201
kevinluo201 / how_to.html.erb
Created November 11, 2018 16:06
spinwear i18n message.js
<div id="how-to">
<div class="mobile-tab fixed-menu">
<div class="rent-steps-tab">租借步驟</div>
<div class="why-spinwear-tab">WHY SPINWEAR</div>
<div class="physical-store-tab">實體店&優惠</div>
</div>
<div class="rent-steps">
<div class="step1">
<div class="step1-texts">
<div class="title">STEP1 線上挑選</div>
@kevinluo201
kevinluo201 / arrow-down-animation.js
Last active October 17, 2018 07:50
下箭頭 icon 動畫
window.setInterval(() => {
let b = parseInt($(".arrow-down").css("bottom")) - 1;
let o = parseFloat($(".arrow-down").css("opacity")) - 1 / 30;
if(b < 0){
b = 30;
o = 1;
}
$(".arrow-down").css({
bottom: b + "px",
opacity: o
@kevinluo201
kevinluo201 / example.rb
Created October 2, 2018 17:14
next, prev
class User
has_many :photos
end
class Photo
belongs_to :user
def next
user.photos.where("id > ?", id).first
@kevinluo201
kevinluo201 / pages.scss
Created September 15, 2018 16:09
scss NotoSans web font 中文
// https://fonts.google.com/earlyaccess#Noto+Sans+TC
// 思源中文字體
@import url(//fonts.googleapis.com/earlyaccess/notosanstc.css);
@import url(//fonts.googleapis.com/earlyaccess/notosanssc.css);
* {
font-family: 'Noto Sans TC', 'Noto Sans SC', 'Helvetica';
line-height: 1.5;
}
@kevinluo201
kevinluo201 / tlen.lsp
Created April 28, 2018 14:23
tlen.lsp
;|
TLEN.LSP - Total LENgth of selected objects
(c) 1998 Tee Square Graphics
|;
(defun C:TLEN (/ ss tl n ent itm obj l)
(setq ss (ssget)
tl 0
@kevinluo201
kevinluo201 / polyarea.lsp
Last active April 28, 2018 14:22
polyarea.lsp
;;POLYAREA.LSP - (c) 1997-2001 Tee Square Graphics
;;
;; Calculates the area of one or more closed polylines and
;; displays the result in an AutoCAD Alert Window.
;;
(defun C:POLYAREA (/ a ss n du)
(setq a 0
du (getvar "dimunit")
ss (ssget '((0 . "*POLYLINE"))))
(if ss
How to setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS
Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing).
The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here:
* Heroku Hostname SSL
* GoDaddy Standard SSL Certificate
* Zerigo DNS
# dfsdf
def gogogo
puts 'hello'
end