Skip to content

Instantly share code, notes, and snippets.

@lemig
lemig / console_history
Created October 31, 2010 15:01
Irb console input history
puts Readline::HISTORY.entries.split("exit").last[0..-2].join("\n")
@lemig
lemig / gist:a78a38136ce1a6b61aba
Created May 19, 2014 14:06
dmoz_regional_categories.rb
# encoding: UTF-8
REGIONAL_CATEGORIES = [
"Regional",
"World/Afrikaans/Streke",
"World/Shqip/Rajonal",
"World/Arabic/إقليمـي",
"World/Aragonés/Rechional",
"World/Armenian/Շրջանային",
"World/Asturianu/Rexonal",
/* 0 */
{
"_id" : ObjectId("54367926f5bcb4a407a1b82c"),
"type" : "page_rank",
"domain" : "clinicasimplante.com",
"path" : null,
"createdAt" : ISODate("2014-10-09T12:01:32.000Z"),
"updatedAt" : [
ISODate("2014-10-09T14:03:33.000Z"),
ISODate("2014-10-09T15:59:47.000Z"),
@lemig
lemig / gist:bd0e00b6b55c0221946b
Last active August 29, 2015 14:09
Elasticsearch config
# elasticsearch
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.0.Beta1.deb
sudo dpkg -i elasticsearch-1.4.0.Beta1.deb
sudo update-rc.d elasticsearch defaults 95 10
sudo apt-get install openjdk-7-jre-headless -y
sudo cp /etc/init.d/elasticsearch /etc/init.d/elasticsearch.original
sudo nano /etc/init.d/elasticsearch
ES_HEAP_SIZE=30g
Duplicate company code: GB, ABX Air.
Duplicate company code: AP, Air One.
Duplicate company code: PL, Airstars.
Duplicate company code: 6V, Axis Airways.
Duplicate company code: KI, Adam Air.
Duplicate company code: GG, Air Comores International.
Duplicate company code: 8C, Air Horizon.
Duplicate company code: W9, Air Bagan.
Duplicate company code: M3, Air Service.
Duplicate company code: BF, Bluebird Cargo.
@lemig
lemig / gist:3277a7bf17ccec81e105
Created November 6, 2015 13:51
Example of feature spec for search
RSpec.feature "View offers", :type => :feature do
let(:ludmilla) { create :customer, email: "ludmilla@schleiper.com", retailer: schleiper }
scenario "Basic search" do
sync do
create(:offer, name: "foo", :public => true)
create(:offer, name: "bar", :public => true)
end
@lemig
lemig / sg_roles.yml
Created March 31, 2017 10:00
Search Guard roles
# Allows any action on the cluster.
sg_all_access:
cluster:
- '*'
indices:
'*':
'*':
- '*'
# Allows reading data from all indices.
# Kibana is served by a back end server. This controls which port to use.
server.port: 5606
# The host to bind the server to.
server.host: "127.0.0.1"
# If you are running kibana behind a proxy, and want to mount it at a path,
# specify that path here. The basePath can't end in a slash.
# server.basePath: ""
# Kibana is served by a back end server. This controls which port to use.
server.port: 5606
# The host to bind the server to.
server.host: "127.0.0.1"
# If you are running kibana behind a proxy, and want to mount it at a path,
# specify that path here. The basePath can't end in a slash.
# server.basePath: ""
@lemig
lemig / libcld.rb
Last active December 31, 2017 14:16
CLD2 brew formula
require 'formula'
# original:
# https://raw.githubusercontent.com/mzsanford/homebrew/libcld/Library/Formula/libcld.rb
# Error: Calling Formula.md5 is disabled!
class Libcld < Formula
head 'https://github.com/mzsanford/cld.git', :using => :git
url 'https://github.com/mzsanford/cld/tarball/v0.1.1'
homepage 'https://github.com/mzsanford/cld'