Skip to content

Instantly share code, notes, and snippets.

{
"clientTracking":{
"hrefURL":"http://www.shopping.com/flowers-and-plants/products",
"titleText":"Flowers and Plants",
"altText":"Flowers and Plants",
"sourceURL":"https://rover.ebay.com/rover/13/0/19/pixel/noscript?PV_EvnTyp=APPV&APPV_APITSP=10%2F26%2F16_05%3A03%3A43_AM&APPV_DSPRQSID=p9.84c601f422cd131102a3&APPV_IMGURL=&APPV_LI_LNKINID=7000610&APPV_LI_SBMKYW=60+Silk+Iris+Flowers+-+New+Blue&APPV_MTCTYP=1000&APPV_PRTID=2002&APPV_BrnID=2455",
"height":"1",
"width":"1",
"type":"pixel"
},
redis-cli -h HOST -p PORT -a PASSWORD keys "search_page_0*" | xargs -n 10000 redis-cli -h HOST -p PORT -a PASSWORD del
module Kaminari
module ActiveRecordRelationMethods
def total_count
1_000_000
end
end
end
@troszok
troszok / some_spec.rb
Created January 21, 2015 15:03
vcr_for_amazon
# based on that: http://myronmars.to/n/dev-blog/2011/10/custom-request-matchers-in-vcr-2-0
uri_without_timestamp = VCR.request_matchers.uri_without_param("Timestamp", "Signature")
context "amazon integration", vcr: {record: :once, :match_requests_on => [:method, uri_without_timestamp]} do
end
-- Index hit rate
WITH idx_hit_rate as (
SELECT
relname as table_name,
n_live_tup,
round(100.0 * idx_scan / (seq_scan + idx_scan),2) as idx_hit_rate
FROM pg_stat_user_tables
ORDER BY n_live_tup DESC
),
require "formula"
class Elasticsearch < Formula
homepage "http://www.elasticsearch.org"
url "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.0.Beta1.tar.gz"
sha1 "5e3d07fdf2d5aab75d49b38fa6743b43f07eef70"
depends_on :java => "1.7"
head do
@troszok
troszok / designer.html
Created October 19, 2014 06:00
designer
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@troszok
troszok / designer.html
Created October 18, 2014 14:46
designer
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@troszok
troszok / install_jenkins_on_ubuntu.sh
Last active August 29, 2015 13:57
install_jenkins_on_ubuntu.sh
# run it with command:
# bash -c "$(curl -fsSL https://gist.github.com/troszok/9598077)"
# wget -O - https://gist.github.com/troszok/9598077 | bash
sudo apt-get -q -y install software-properties-common python-software-properties
sudo add-apt-repository ppa:webupd8team/java
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -
echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list
apt-get update -y