Skip to content

Instantly share code, notes, and snippets.

# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
@bandicoot86
bandicoot86 / gist:7512823
Last active December 28, 2015 14:09
Create with rspec test
rails new app_name --skip-test-unit && cd app_name &&
echo "group :development, :test do
gem 'rspec-rails'
end" >> Gemfile &&
rails generate rspec:install
@bandicoot86
bandicoot86 / gist:7598487
Created November 22, 2013 11:31
Nodejs rest request
var http = require('http');
var data = JSON.stringify({
'id': '2'
});
var options = {
host: 'localhost',
port: '8094',
path: '/spring-rest-core/service/api/vv',
@bandicoot86
bandicoot86 / gist:8121627
Created December 25, 2013 09:14
Set new version to all modules.
mvn versions:set -DnewVersion=2.50.1-SNAPSHOT
@bandicoot86
bandicoot86 / gist:8174390
Created December 29, 2013 20:21
Github aliases
http://durdn.com/blog/2012/11/22/must-have-git-aliases-advanced-examples/?utm_content=buffera99d5&utm_source=buffer&utm_medium=twitter&utm_campaign=Buffer#!
@bandicoot86
bandicoot86 / gist:9808145
Created March 27, 2014 13:57
List all files in a comma separated fashion.
ls -dm */*
@bandicoot86
bandicoot86 / gist:10460546
Created April 11, 2014 11:33
Bash job to run mapreduce jobs
#!/bin/bash
echo 'Start running MR job'
java -jar hbase-tool-1.0.jar -mapreduce -h 10.1.5.227 -sd 17.10.2013+13:00:00 -ed 18.10.2014+00:00:00 -toDb -dbhost vm-rdbms -dbport 1521 -dbuser unifo -dbpass 1234 -dbsid UNIFO
echo 'Job ended'
@bandicoot86
bandicoot86 / tablespace_oracle
Created May 15, 2014 13:05
Find string with negative look-ahead
^TABLESPACE "((?!USERS)[\w'-]+")
perl -p -i -e 's/^TABLESPACE \"((?!USERS)[\w-]+")/TABLESPACE USERS/g' file1 file2
@bandicoot86
bandicoot86 / gist:4a0f74a35af6fdd45606
Created May 15, 2014 16:01
Perl to replace via regexp
perl -p -i -e 's/TABLESPACE\s+\n\s+"((?!USERS)[\w-]+")/TABLESPACE USERS/g' gis-gmp-db.ddl