Ctrl+KB | toggle side bar |
Ctrl+Shift+P | command prompt |
Ctrl+` | python console |
Ctrl+N | new file |
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
URL: http://user:[email protected]/v1/properties/?facet.mincount=1&facet.sort=count&f.sale_price.facet.sort=index&filter.city=London&facet.limit=-1&f.area_sqft.facet.sort=index&facet.field=sale_price&facet.field=property_types&facet.field=bedrooms&facet.field=bathrooms&facet.field=modified_at&facet.field=area_sqft&f.property_types.facet.sort=index&f.bedrooms.facet.sort=index&f.modified_at.facet.sort=index&f.area_sqft.facet.buckets=0%2C500%2C800%2C1000%2C1500%2C2000%2C2500%2C3000%2C4000%2C5000%2C%2A&sort=city+asc%2Csale_price+desc&filter.transaction=buy&f.bathrooms.facet.sort=index&f.sale_price.facet.buckets=0%2C100000%2C200000%2C300000%2C500000%2C750000%2C800000%2C1000000%2C1500000%2C2000000%2C%2A&f.modified_at.facet.buckets=2011-01-12T11%3A06%3A29Z%2C2011-04-14T12%3A06%3A29Z%2C2011-06-14T12%3A06%3A29Z%2C2011-07-01T12%3A06%3A29Z%2C2011-07-08T12%3A06%3A29Z%2C2011-07-12T12%3A06%3A29Z%2C2011-07-14T12%3A06%3A29Z%2C2011-07-15T12%3A06%3A29Z | |
Here is a readable dump of the URL | |
12:06:31 action_view http://l |
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
<%= simple_form_for @search, :as => :search_manufacturer, :url => search_index_url(:search => @search.to_hash), :html => {:novalidate => true, :method => :get} do |search_form|%> | |
<% SimpleForm.wrapper_tag = nil %> | |
<!-- Center everything --> | |
<div class="center-content" itemscope itemtype ="http://schema.org/Product"> | |
<article> | |
<!-- 1 column box with tabs --> | |
<div class="tabs"> | |
<nav> | |
<%= render_filter search_form, @search.filter("boat_manufacturer") %> | |
</nav> |
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 validate params | |
raise OURERROR if !(self.manufacturer == params[:manufacturer] and self.country_code and params[:country_code] and self.model == params[:model]) | |
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 validate params | |
[:manufacturer, :model, :country_code].each do |field| | |
incoming_param = params[field].blank? ? '' : params[field] | |
field_value = self.send(field).blank? ? '' : self.send(field) | |
if field_value != incoming_param | |
error = Api::Errors::BadRequest.new('Bad Request it should be like manufacturer-country_code-model') | |
raise error | |
end | |
end | |
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
diff --git a/vqmod/xml/product-image-zoom.xml b/vqmod/xml/product-image-zoom.xml | |
index 3af73b8..936c8b9 100644 | |
--- a/vqmod/xml/product-image-zoom.xml | |
+++ b/vqmod/xml/product-image-zoom.xml | |
@@ -3,13 +3,13 @@ | |
<version>2</version> | |
<vqmver>2.0</vqmver> | |
<author>www.backonoc.com</author> | |
- <file name="catalog/view/theme/default/template/common/header.tpl"> | |
+ <file name="catalog/view/theme/*/template/common/header.tpl"> |
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_for_root_only = ((root_ol rescue true) ? 'sortable' : @first_call = '') | |
ol class=class_for_root_only data-sort-url=sort_website_pages_path(@website) | |
li id="list_#{page.id}" | |
.handle | |
= link_to page.name, edit_website_page_path(@website, page) | |
' | |
= active_icon(page, :published) | |
.btn-group.pull-right | |
= link_to t('View'), website_page_path(@website, page), :class => 'btn btn-mini' |
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
Models | |
class User | |
ransacker :full_name, :formatter => proc {|v| UnicodeUtils.downcase(v) } do |parent| | |
Arel::Nodes::NamedFunction.new('LOWER', | |
[Arel::Nodes::NamedFunction.new('concat_ws', [' ', parent.table[:first_name], parent.table[:middle_name], parent.table[:last_name]])] | |
) | |
end | |
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
desc "Sync the schema_migrations tables on both databases" | |
task :sync_schema_migrations => :environment do | |
class JoomlaSchemaMigrations < ActiveRecord::Base | |
establish_connection "joomla_#{Rails.env}" | |
self.table_name = 'schema_migrations' | |
self.inheritance_column = :sti_type | |
attr_accessible :version | |
end | |
class RailsSchemaMigrations < ActiveRecord::Base |
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 SampleJob | |
def perform | |
begin | |
# do all your work in the begin block. | |
puts "hello world" | |
rescue Exception => e | |
# rescue any errors so that you know something went wrong. Email yourself the error if you need. | |
error_msg = "#{Time.now} ERROR (SampleJob#perform): #{e.message} - (#{e.class})\n#{(e.backtrace or []).join("\n")}" | |
puts error_msg | |
ensure |