This file contains 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
insertAtCaret = (areaId, text) -> | |
txtarea = $("#t1").get(0) | |
scrollPos = txtarea.scrollTop | |
strPos = 0 | |
br = ((if (txtarea.selectionStart or txtarea.selectionStart is "0") then "ff" else ((if document.selection then "ie" else false)))) | |
if br is "ie" | |
txtarea.focus() | |
range = document.selection.createRange() | |
range.moveStart "character", -txtarea.value.length | |
strPos = range.text.length |
This file contains 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
jQuery -> | |
new Sliders() | |
class Sliders | |
constructor: -> | |
_self = this | |
if typeof $.fn.checkbox isnt 'undefined' | |
$('input[type=checkbox]').checkbox(cls:'jquery-safari-checkbox') | |
if typeof $.fn.selectBox isnt 'undefined' |
This file contains 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
jQuery -> | |
if typeof $.fn.jCarouselLite isnt 'undefined' | |
$("#slider_1").jCarouselLite | |
btnNext: "#slider_1 .next" | |
btnPrev: "#slider_1 .prev" | |
visible: 1 | |
This file contains 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
jQuery -> | |
if $.fn.jCarouselLite? | |
$("#slider_1").jCarouselLite | |
btnNext: "#slider_1 .next" | |
btnPrev: "#slider_1 .prev" | |
visible: 1 | |
This file contains 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="widget" id="price_container"> | |
<h3><%= t :general, scope: :sidebar %></h3> | |
<div class="box"> | |
<div class="item"> | |
<h4><%= t :price, scope: :sidebar %></h4> | |
<span class="left">0 $</span> | |
<span class="right">2.000000$</span> | |
<%= f.text_field :price_gteq, value: [params[:q][:price_gteq], params[:q][:price_lteq]].join(';') %> | |
</div> | |
<div class="item"> |
This file contains 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 LandingController < ApplicationController | |
layout "landing2" | |
def index | |
@zones = Zone.all | |
@zone_id ||= 1 | |
@q = Property.search(params[:q]) | |
@q.build_sort if @q.sorts.empty? | |
end | |
end |
This file contains 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 crawl_in_parallel(urls=[], type, subcategory) | |
hydra = Typhoeus::Hydra.new(:max_concurrency => 5) | |
urls.each do |url| | |
request = Typhoeus::Request.new(url, | |
timeout: 7000, | |
follow_location: true, | |
) | |
request.on_complete do |response| |
This file contains 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
Given /^the input "([^"]*)"$/ do |input| | |
@input = input | |
end | |
When /^the calculator is run$/ do | |
@output = "ruby calc.rb #{@input}" | |
raise "Command failed!" unless $?.success? | |
end | |
Then /^the output should be "([^"]*)"$/ do |arg1| |