Skip to content

Instantly share code, notes, and snippets.

View kevin-shu's full-sized avatar

Kevin Shu kevin-shu

  • Apple Buds, Inc.
  • Taiwan
View GitHub Profile
http://www.hollisterco.com/shop/wd/dudes-graphic-t-shirts-t-shirts/surfriders-beach-t-shirt-1423459_01 (white_and_pink)
http://www.hollisterco.com/shop/wd/dudes-short-sleeve-t-shirts/silver-strandt-shirt-1154870_02 (navy)
http://www.hollisterco.com/shop/wd/dudes-graphic-t-shirts-t-shirts/santa-monica-t-shirt-1155453_04 (white)
class User < ActiveRecord::Base
serialize :diversity, JSON
end
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId : '313930528750470', // App ID from the app dashboard
channelUrl : 'http://runway.tw/luckdraw/index.html', // Channel file for x-domain comms
status : true, // Check Facebook Login status
xfbml : true // Look for social plugins on the page
});
FB.login(function(response) {
if (response.authResponse) {
@kevin-shu
kevin-shu / gist:5748370
Last active December 18, 2015 07:39
get current_user_id in controller
def current_user_id
session["warden.user.user.key"][1][0]
end
中國: 37
HK: 77
JP: 89
Korea: 94
澳門: 104
cart = []
session[:cart].each do |key, value|
cart.push {product_id:key, amount:value}
end
Order.create cart
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.6.deb
sudo dpkg -i elasticsearch-0.20.6.deb
.lb-conter a{
color:#288bac;
text-decoration:underline;
}
.lb-conter a:hover{
color:rgb(0, 153, 204);
@kevin-shu
kevin-shu / gist:5523194
Created May 6, 2013 03:20
Client-side resizing example
<html>
<head>
<title>Client-side resizing example</title>
</head>
<body>
<input id="file-uploader" type="file"/>
<!-- <p>Image to use:</p>
<img id="cat" src="./cat.jpg" alt="The Scream" > -->
#controller這樣寫:
class ConsultantController << ApplicationController
# routing: post "consultant/create" => "consultant#create"
def create
Consultant.create params[:consultant]
end
end
#view這樣寫:
<form action="/consultant/create" method="post">