Skip to content

Instantly share code, notes, and snippets.

View kevinluo201's full-sized avatar

Kevin Luo kevinluo201

View GitHub Profile
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
kevinluo@KevinUbuntu:~/projects/groupmy$ rails server
/home/kevinluo/.rvm/gems/ruby-2.1.1/gems/execjs-2.0.2/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/kevinluo/.rvm/gems/ruby-2.1.1/gems/execjs-2.0.2/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/kevinluo/.rvm/gems/ruby-2.1.1/gems/execjs-2.0.2/lib/execjs.rb:4:in `<top (required)>'
from /home/kevinluo/.rvm/gems/ruby-2.1.1/gems/uglifier-2.5.0/lib/uglifier.rb:3:in `require'
from /home/kevinluo/.rvm/gems/ruby-2.1.1/gems/uglifier-2.5.0/lib/uglifier.rb:3:in `<top (required)>'
from /home/kevinluo/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:76:in `require'
from /home/kevinluo/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/kevinluo/.rvm/gems/ruby-2.1.1@global/gems/bund
# dfsdf
def gogogo
puts 'hello'
end
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
@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
@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 / 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 / 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 / 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