Skip to content

Instantly share code, notes, and snippets.

Avatar

Robert Reiz reiz

View GitHub Profile
@reiz
reiz / gist:9468356
Created Mar 10, 2014
VersionEye ES mapping
View gist:9468356
def self.create_index_with_mappings
Tire.index Settings.elasticsearch_product_index do
create :settings => {
:number_of_shards => 1,
:number_of_replicas => 1,
:analysis => {
:filter => {
:name_ngrams => {
:side => 'front',
:type => 'edgeNGram',
@reiz
reiz / gist:aaed4eafbc0460b4d738
Created May 31, 2014
Countries HashMap with numeric code key.
View gist:aaed4eafbc0460b4d738
countries = {
"004" => { "alpha-3-code" => "AFG", "alpha-2-code" => "AF", "name" => "Afghanistan" },
"248" => { "alpha-3-code" => "ALA", "alpha-2-code" => "AX", "name" => "Åland Islands" },
"008" => { "alpha-3-code" => "ALB", "alpha-2-code" => "AL", "name" => "Albania" },
"012" => { "alpha-3-code" => "DZA", "alpha-2-code" => "DZ", "name" => "Algeria" },
"016" => { "alpha-3-code" => "ASM", "alpha-2-code" => "AS", "name" => "American Samoa" },
"020" => { "alpha-3-code" => "AND", "alpha-2-code" => "AD", "name" => "Andorra" },
"024" => { "alpha-3-code" => "AGO", "alpha-2-code" => "AO", "name" => "Angola" },
"660" => { "alpha-3-code" => "AIA", "alpha-2-code" => "AI", "name" => "Anguilla" },
"010" => { "alpha-3-code" => "ATA", "alpha-2-code" => "AQ", "name" => "Antarctica" },
@reiz
reiz / gist:bf667b378e8de3dccfaf
Created May 31, 2014
Country list with alpha-2-code kye
View gist:bf667b378e8de3dccfaf
countries = {
"AF" => "Afghanistan",
"AX" => "Åland Islands",
"AL" => "Albania",
"DZ" => "Algeria",
"AS" => "American Samoa",
"AD" => "Andorra",
"AO" => "Angola",
"AI" => "Anguilla",
"AQ" => "Antarctica",
@reiz
reiz / gist:fe69e6f893d4e4642f8d
Created Jun 1, 2014
HashMap of EU Countries
View gist:fe69e6f893d4e4642f8d
A_EU = {
"AT" => "Austria",
"BE" => "Belgium",
"BG" => "Bulgaria",
"HR" => "Croatia",
"CY" => "Cyprus",
"CZ" => "Czech Republic",
"DK" => "Denmark",
"EE" => "Estonia",
"FI" => "Finland",
@reiz
reiz / gist:b306b6a6f265841f57bd
Created Jun 21, 2014
Dockerfile for MongoDB 2.6.2 on ubuntu 13.10
View gist:b306b6a6f265841f57bd
FROM ubuntu:13.10
MAINTAINER Robert Reiz <reiz@versioneye.com>
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
RUN echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/10gen.list
RUN apt-get update
RUN apt-get install -y --force-yes -q apt-utils
RUN apt-get install -y --force-yes -q adduser
RUN apt-get install -y --force-yes -q mongodb-org-server=2.6.2
RUN apt-get install -y --force-yes -q mongodb-org=2.6.2
@reiz
reiz / gist:a2b76b37279c4fd11287
Created Jun 29, 2014
Dockerfile reiz/mongodb:1.0.2
View gist:a2b76b37279c4fd11287
FROM ubuntu:13.10
MAINTAINER Robert Reiz <reiz@versioneye.com>
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
RUN echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/10gen.list
RUN apt-get update
RUN apt-get install -y --force-yes -q apt-utils
RUN apt-get install -y --force-yes -q adduser
RUN apt-get install -y --force-yes -q mongodb-org-server=2.6.3
RUN apt-get install -y --force-yes -q mongodb-org=2.6.3
@reiz
reiz / gist:3cdbbd257208526fe51c
Created Jul 12, 2014
Dockerfile for MRI Ruby 2.1.2 on Ubuntu 13.10
View gist:3cdbbd257208526fe51c
FROM ubuntu:13.10
MAINTAINER Robert Reiz <reiz@versioneye.com>
RUN apt-get update
RUN apt-get upgrade -y -q
RUN apt-get install -y -q wget tree links2 gcc g++ make autoconf automake libssl-dev libcurl4-openssl-dev
RUN echo LC_ALL=en_US.UTF-8 >> /etc/environment
RUN export LC_ALL=en_US.UTF-8
@reiz
reiz / gist:0190f8503152f5af9e38
Created Jul 13, 2014
rubnius git master head installation error on ubuntu 13.10
View gist:0190f8503152f5af9e38
./configure --prefix=/rbx
------------------------- WARNING -----------------------
The specified prefix '/rbx' already exists.
Installing Rubinius into an existing directory may
overwrite existing unrelated files or cause conflicts
between different versions of Rubinius files.
---------------------------------------------------------
Checking gcc: found
Checking g++: found
Checking bison: found
@reiz
reiz / changelog.xml
Created Sep 11, 2015
changelog.xml for VersionEye Maven Plugin 3.5.1
View changelog.xml
<?xml version="1.0" encoding="UTF-8"?>
<changelog>
<revision_base>https://github.com/versioneye/versioneye_maven_plugin/commit/</revision_base>
<changeset datePattern="yyyyMMdd HH:mm:ss z" startVersion="3.5.0" endVersion="3.5.1">
<changelog-entry>
<date pattern="yyyy-MM-dd">2015-06-30</date>
<time pattern="HH:mm:ss">15:33:16</time>
<author><![CDATA[Robert Reiz <robert.reiz.81@gmail.com>]]></author>
<file>
<action>modified</action>
@reiz
reiz / gemfile parser
Created Jun 18, 2012
Parsing a Gemfile
View gemfile parser
def self.create_from_gemfile_url ( url )
return nil if url.nil?
if url.match(/^https:\/\/github.com\//)
url = url.gsub("https://github.com", "https://raw.github.com")
url = url.gsub("/blob/", "/")
end
uri = URI.parse( url )
http = Net::HTTP.new(uri.host, uri.port)
if uri.port == 443
http.use_ssl = true