Skip to content

Instantly share code, notes, and snippets.

View Evshved's full-sized avatar
🌬️
Yes Yes No. I grabbed the wind.

Eugene Shved Evshved

🌬️
Yes Yes No. I grabbed the wind.
View GitHub Profile
/*
* Load Main Bootstrap LESS files
*/
/*!
* Bootstrap v3.3.6 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
upstream related__fix_staging_unicorn {
server unix:/srv/sites/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
deny 84.200.14.0/24;
listen 80;
server_name staging.topalternate.com;
var items = {<%= @user_similar_ratings.map{|key, value| "'#{key}':'#{value}'"}.join(", ") %> };
<style>
.sticky {
position: fixed;
top: 0px; /* если ноль заменить на число (и в скрипте тоже), то блок будет прилипать до того, как верхний край окна браузера дойдёт до верхнего края элемента. Может быть отрицательным числом. Применим, например, при фиксированном сверху меню */
z-index: 101;
}
</style>
(function(){ // анонимная функция (function(){ })(), чтобы переменные "a" и "b" не стали глобальными
var a = document.querySelector('.hidden-768'), b = null; // селектор блока, который нужно закрепить
window.addEventListener('scroll', Ascroll, false);
<!DOCTYPE html>
<html xmlns:og="http://ogp.me/ns#">
<head>
<title>Widget for youtube.com from TopAlternate</title>
<link href="/assets/application.css" media="screen" rel="stylesheet" type="text/css" />
<script src="/assets/application.js" type="text/javascript"></script>
<meta content="authenticity_token" name="csrf-param" />
<meta content="xU3AWmY0Yy9OY4pohzMUaRuiWzFmBWPImeqgE25PW0s=" name="csrf-token" />
<link rel="shortcut icon" href="/favicon.ico"/>
<link rel="shortcut icon" href="/favicon.ico"/>
!function(e,t){$window=e(t),e.fn.lazyload=function(o){function n(){var t=0;i.each(function(){var o=e(this);if(!r.skip_invisible||o.is(":visible"))if(e.abovethetop(this,r)||e.leftofbegin(this,r));else if(e.belowthefold(this,r)||e.rightoffold(this,r)){if(++t>r.failure_limit)return!1}else o.trigger("appear")})}var i=this,r={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:t,data_attribute:"original",skip_invisible:!0,appear:null,load:null};return o&&(void 0!==o.failurelimit&&(o.failure_limit=o.failurelimit,delete o.failurelimit),void 0!==o.effectspeed&&(o.effect_speed=o.effectspeed,delete o.effectspeed),e.extend(r,o)),$container=void 0===r.container||r.container===t?$window:e(r.container),0===r.event.indexOf("scroll")&&$container.bind(r.event,function(e){return n()}),this.each(function(){var t=this,o=e(t);t.loaded=!1,o.one("appear",function(){if(!this.loaded){if(r.appear){var n=i.length;r.appear.call(t,n,r)}e("<img />").bind("load",function(){o.hide().attr("src",o.data(r.data_attribute))[r.effe
root@ip-172-31-27-119:/srv/fix_parser/sites/current# RAILS_ENV=production rake resque:stop_workers
rake aborted!
LoadError: cannot load such file -- pry
/srv/fix_parser/sites/shared/bundle/ruby/2.0.0/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:240:in `require'
/srv/fix_parser/sites/shared/bundle/ruby/2.0.0/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:240:in `block in require'
/srv/fix_parser/sites/shared/bundle/ruby/2.0.0/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:223:in `block in load_dependency'
/srv/fix_parser/sites/shared/bundle/ruby/2.0.0/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:640:in `new_constants_in'
/srv/fix_parser/sites/shared/bundle/ruby/2.0.0/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:223:in `load_dependency'
/srv/fix_parser/sites/shared/bundle/ruby/2.0.0/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:240:in `require'
/srv/fix_parser/sites/releases/20170901124644/vendor/plugins/search_parser/lib/searc
@Evshved
Evshved / pry.rb
Created August 22, 2017 17:08
Output
[1] pry(#<RelatedSearchWorker>)> @search_parsers
=> [#<SearchParser::Parser::GoogleRelatedParser:0x00000008570410
@cookies=
"NID=110=HFSiKlCsLEYEMXtK0IAfqYmHCVen-D5ZJEAZT; expires=Wed, 21-Feb-2018 16:51:05 GMT; path=/; domain=.google.com; HttpOnly",
@domain="google.com",
@not_found=false,
@results=
[{:url=>"https://www.bing.com/", :title=>"Bing", :domain=>"www.bing.com", :short_domain=>"bing.com"},
{:url=>"https://www.yahoo.com/", :title=>"Yahoo", :domain=>"www.yahoo.com", :short_domain=>"yahoo.com"},
{:url=>"https://search.yahoo.com/", :title=>"Yahoo Search - Web Search", :domain=>"search.yahoo.com", :short_domain=>"yahoo.com"},
class CreateSites < ActiveRecord::Migration
def up
create_table :related_sites, :options=>"DEFAULT CHARSET=utf8" do |t|
t.string :title, null: false, default: ''
t.string :domain_name, null: false, default: ''
t.string :hash_domain, null: false, default: ''
domain_name varchar(255) NOT NULL DEFAULT '',
hash_domain varchar(32) CHARACTER SET latin1 NOT NULL DEFAULT '',
description mediumtext,
status tinyint(2) NOT NULL DEFAULT '0',
# He wants the following functions to work as expected:
# even # [1,2,3,4,5].even should return [2,4]
# odd # [1,2,3,4,5].odd should return [1,3,5]
# under # [1,2,3,4,5].under(4) should return [1,2,3]
# over # [1,2,3,4,5].over(4) should return [5]
# in_range # [1,2,3,4,5].in_range(1..3) should return [1,2,3]
# They should also work when used together, for example:
# (1..100).to_a.even.in_range(18..30) # should return [18, 20, 22, 24, 26, 28, 30]
# And finally the filters should only accept integer values from an array, for example:
# ["a", 1, "b", 300, "x", "q", 63, 122, 181, "z", 0.83, 0.11].even # should return [300, 122]