Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View reiz's full-sized avatar

Robert Reiz reiz

View GitHub Profile
@reiz
reiz / gist:0190f8503152f5af9e38
Created July 13, 2014 15:57
rubnius git master head installation error on ubuntu 13.10
./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 / gist:3cdbbd257208526fe51c
Created July 12, 2014 17:23
Dockerfile for MRI Ruby 2.1.2 on Ubuntu 13.10
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:a2b76b37279c4fd11287
Created June 29, 2014 16:42
Dockerfile reiz/mongodb:1.0.2
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:b306b6a6f265841f57bd
Created June 21, 2014 06:53
Dockerfile for MongoDB 2.6.2 on ubuntu 13.10
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:fe69e6f893d4e4642f8d
Created June 1, 2014 18:18
HashMap of EU Countries
A_EU = {
"AT" => "Austria",
"BE" => "Belgium",
"BG" => "Bulgaria",
"HR" => "Croatia",
"CY" => "Cyprus",
"CZ" => "Czech Republic",
"DK" => "Denmark",
"EE" => "Estonia",
"FI" => "Finland",
@reiz
reiz / gist:bf667b378e8de3dccfaf
Created May 31, 2014 14:50
Country list with alpha-2-code kye
countries = {
"AF" => "Afghanistan",
"AX" => "Åland Islands",
"AL" => "Albania",
"DZ" => "Algeria",
"AS" => "American Samoa",
"AD" => "Andorra",
"AO" => "Angola",
"AI" => "Anguilla",
"AQ" => "Antarctica",
@reiz
reiz / gist:aaed4eafbc0460b4d738
Created May 31, 2014 14:35
Countries HashMap with numeric code key.
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:9468356
Created March 10, 2014 16:24
VersionEye ES mapping
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:6203767
Created August 11, 2013 06:52
Creating a MavenProject from an ArtifactInfo inside a maven plugin.
protected MavenProject buildProjectModel(ArtifactInfo artifactInfo) throws Exception {
try {
ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
configuration.setLocalRepository( localRepository );
configuration.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL );
configuration.setProcessPlugins( false );
configuration.setRepositoryMerging( ProjectBuildingRequest.RepositoryMerging.REQUEST_DOMINANT );
Properties properties = new Properties( );
for ( String key : session.getSystemProperties( ).keySet() ){
properties.put( key, session.getSystemProperties().get(key) );
@reiz
reiz / gemfile parser
Created June 18, 2012 09:36
Parsing a Gemfile
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