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
@search_term = "laptop" | |
filters = | |
[ | |
{ | |
:key=>"product_group_id", | |
:value=>[ | |
24757869, | |
24757869, | |
24757869, |
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
$ Torque.store('ask_an_owner_questions', data) | |
=> { | |
"_index"=>"torque-ask_an_owner_questions", | |
"_type"=>"document", | |
"_id"=>"483518", | |
"_version"=>1, | |
"result"=>"created", | |
"_shards"=>{ | |
"total"=>2, |
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
import luigi | |
import luigi.contrib | |
import luigi.contrib.mysqldb | |
import MySQLdb | |
""" | |
This simple worflow works like this: | |
1. Read 12 records from reviews table in local revieworld_live DB | |
2. Insert those 12 records (only review_id and published date) into local luigi_test_1 table in test DB | |
3. Read 12 records from local luigi_test_1 table in test DB |
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
import luigi | |
import luigi.contrib | |
import luigi.contrib.mysqldb | |
import MySQLdb | |
""" | |
This simple worflow works like this: | |
1. Read 12 records from reviews table in local revieworld_live DB | |
2. Insert those 12 records (only review_id and published date) into local luigi_test_1 table in test DB | |
3. Read 12 records from local luigi_test_1 table in test DB |
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
{ | |
"banner": { | |
"name": "sale", | |
"id": 21505, | |
"link": "http://www.dev.noths.com/api/categories/21505/products", | |
"images": { | |
"mobile": { | |
"x2": "http://www.dev.noths.com/images/iphone/banners/mobile/banner_x2.jpg", | |
"x3": "http://www.dev.noths.com/images/iphone/banners/mobile/banner_x3.jpg" | |
}, |
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
namespace :reindex_sunspot do | |
desc 'Reindexing cats' | |
task :cats_start => :environment do | |
Rails.logger.info("Meeeeeeoooowwww") | |
system("echo y | bundle exec rake sunspot:reindex[500,Cat]") | |
Rails.logger.info("Mmmrrrrrrrrr") | |
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
task :update_prices, [:first_arg, :last_arg] => :environment do |task, args| | |
Rails.logger.info(args.first_arg) | |
Rails.logger.info(args.last_arg) | |
... | |
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
namespace :plans do | |
desc "Create new prices for existing plans" | |
task update_prices: :environment do | |
Rails.logger.info("Start updating plans!") | |
Plan.premium.six_months.each do |p| | |
p.prices.create(currency: "USD", unit_amount: 60) | |
p.prices.create(currency: "EUR", unit_amount: 60) | |
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
@font-face { | |
font-family: 'Flat-UI-Icons'; | |
src: url('Flat-UI-Icons.eot'); | |
src: url('Flat-UI-Icons.eot?#iefix') format('embedded-opentype'), url('Flat-UI-Icons.woff') format('woff'), url('Flat-UI-Icons.ttf') format('truetype'), url('Flat-UI-Icons.svg#Flat-UI-Icons') format('svg'); | |
font-weight: normal; | |
font-style: normal; | |
} | |
/* Use the following CSS code if you want to use data attributes for inserting your icons */ | |
[data-icon]:before { | |
font-family: 'Flat-UI-Icons'; |
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 setup_negative_captcha | |
@captcha = NegativeCaptcha.new( | |
secret: ENV['NEGATIVE_CAPTCHA_SECRET'], | |
spinner: request.remote_ip, | |
fields: [:author, :content], | |
params: params | |
) | |
end |
NewerOlder