This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
中國: 37 | |
HK: 77 | |
JP: 89 | |
Korea: 94 | |
澳門: 104 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def current_user_id | |
session["warden.user.user.key"][1][0] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
serialize :diversity, JSON | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1..10).each do |i| | |
puts member["id_#{i}"] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |