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
中國: 37
HK: 77
JP: 89
Korea: 94
澳門: 104
@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
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) {
class User < ActiveRecord::Base
serialize :diversity, JSON
end
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)
select carts.`order_number`, products.`shipping_itemsize`, count(products.`shipping_itemsize`)
from carts inner join products on carts.`product_id` = products.`id`
group by carts.order_number, products.`shipping_itemsize`;
carts = Arel::Table.new(:carts)
products = Arel::Table.new(:products)
orders = Arel::Table.new(:orders)
subquery = carts.join(products).project("carts.order_number, products.shipping_itemsize as size, count(products.shipping_itemsize) as size_count").group("carts.order_number, products.shipping_itemsize")
(1..10).each do |i|
puts member["id_#{i}"]
end

團隊照片

束凱文 Kevin

束凱文

劉軒銘 Shane

劉軒銘

劉大智 Phelps

劉大智

rbenv install 1.9.3-p194
rbenv rehash # for paranoia's sake
rbenv global 1.9.3-p194
gem env # to check that everything was pointing at 1.9 and not the system
gem install --no-ri --no-rdoc bundler
rbenv rehash # necessary to load up the bundle executable
bundle --path=vendor/bundle