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
<div class="row"> | |
<div class="col-xs-2"> | |
<p class="lead">Step <span id="id_no">1</span> of <%= parts_values.size %></p> | |
</div> | |
<div class="col-xs-10"> | |
<div class="progress"> | |
<div class="progress-striped progress-bar " role="progressbar" style="width: 16%;"> | |
</div> | |
</div> | |
</div> |
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
lib/martmobi/crawler | |
-base_category.rb | |
-shopify/ | |
-shopify.rb | |
====================== | |
base_category.rb | |
----------------- | |
module Martmobi | |
module Crawler |
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 ApplicationController < ActionController::Base | |
before_filter :authenticate_user_with_registration!, :set_current_user, :ban_ip, except: [:ban_ip] | |
before_filter :set_last_seen_at, if: proc { |p| user_signed_in? && (session[:last_seen_at] == nil || session[:last_seen_at] < 15.minutes.ago) } | |
protect_from_forgery | |
layout :layout | |
def current_user_with_registration | |
current_user_without_registration || current_registration | |
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
def authenticate_user_with_registration! | |
authenticate_user_without_registration! || authenticate_registration! | |
end | |
alias_method_chain :authenticate_user! , :registration |
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
var fs = require('fs'), mongoose = require('mongoose'), util = require('util'), async = require('async'), types = mongoose.Schema.Types; | |
var mongoose_conn; | |
if (process.argv[3] === 'staging') {//staging | |
mongoose_conn = util.format('mongodb://martmobi_rw:vThPQBu32H3x@%s:%d/%s', '162.13.94.186', '27017', 'magento_sync_production'); | |
} else if (process.argv[3] === 'production') {//live | |
mongoose_conn = util.format('mongodb://martmobi_rw:Dd6e3g7c8@%s:%d/%s', '95.138.168.92', '27017', 'magento_sync_production'); | |
} | |
mongoose.connect(mongoose_conn, {}); | |
// CONNECTION EVENTS |
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
26 render: function() { | |
27 this._super("render", []); | |
28 if(this.options.order_popup === 'true') { | |
29 this._postOrderTasks(); | |
30 } | |
31 this._initSlider(); | |
32 }, | |
33 getSpecificTemplateValues: function() { | |
34 var speed_bucket = bootstrapData.speed_bucket=="VERY_SLOW"?"SLOW":[bootstrapData.speed_bucket]; | |
35 if(!this.model.attributes.banners.length){ |
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
devise_scope :registration do | |
authenticated :registration do | |
root to: 'enquiries#index', as: :authenticated_root | |
end | |
end | |
devise_scope :user do | |
authenticated :user do | |
root to: 'enquiries#index', as: :authenticated_root | |
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
class AuditorObserver < ActiveRecord::Observer | |
observe :enquiry,:note,:follow_up,:programme, | |
:registration,:email,:application_status, | |
:contact_type,:course_level,:course_subject,:doc_category, | |
:english_level,:enquiry_status,:event_type,:exam_type, | |
:qualification,:student_source, | |
:todo_topic,:institution_type,:institution_group, | |
:contract,:contract_doc_category,:person_type, | |
:person,:commission_status,:branch, |
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 get_prods_by_mode(store, options={}) | |
filters = {} | |
backend = store.backend['type'].to_sym | |
options[:mode] = 'regular' unless options.has_key?(:mode) | |
shopify_categories = Category.of_store(store.id). | |
active.pluck(:src_cat_id) if backend == :shopify | |
case options[:mode] | |
when"filter_by_date" | |
if options[:updated_after] | |
begin |
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 Product | |
include Mongoid::Document | |
include Mongoid::Timestamps::Short | |
include Tire::Model::Search | |
include Tire::Model::Callbacks | |
cattr_accessor :mag_libs_cache | |
def self.get_prods_by_mode(store, options={}) |