RVM is a command-line tool which allows you to easily install, manage, and work with multiple ruby
environments from interpreters to sets of gems. To install Ubuntu in RVM 1. Check Apache and Mysql existed in your machine.
In /var/www/index.html type <?php phpinfo(); ?> , then type http://localhost or http://127.0.0.1 on your browser. If apache installation in your machine already correct, your browser will load PHP informations installed on your machine
source ~/.bash_profile .Note : This command is for reload opened terminal.
rvm requirements. Note : This command is for searching all libs that still needed, and then install the lib.
3. Install Ruby according to the version we need:
rvm install 1.9.3
4.Install another version of ruby with this method. 5. To view all installed RVM
rvm list
6.To use specifics RVM
rvm use 1.9.3
7.If there is an error when running rvm use 1.9.3 try open file ~/.bashrc and ~/.bash_profile and then add this script : [[
-s "$HOME/.rvm/scripts/rvm" ]] && source
"$HOME/.rvm/scripts/rvm" # Load RVM into a shell
session 8. To use Specifics Gemset
The MongoDB PHP driver should work on nearly any system: Windows, Mac OS X, Unix, and Linux; little- and big-endian machines; 32- and 64-bit machines; PHP 5.2, 5.3, 5.4 and 5.5. Install MongoDB Driver PHP
sudo pecl install mongo
Add extension=mongo.so in php.ini (/etc/php5/cli/php.ini)
Restart Apache: sudo service apache2 restart
Check Installed MongoDB
Check is MongoDB extensions already loaded in your PHP
php --ini already installed: /etc/php5/cli/conf.d/mongo.ini
Check is MongoDB extesions already enabled
php -i | grep 'Mongo'
Already Enabled: MongoDB Support => enabled
Java Runtime Enviroment also known as JRE is part of Java Development Kit JDK a software development environment for writing Java applications. JRE consist Java Virtual Machine, core classes, and supporting files.
Installing JRE on ubuntu is a little bit different with installation JDK. First, Download the JRE file in here. Remember to download JRE version based on your system version either it's 32bit or 64bit.
After finished downloading your JRE version, we can begin the installation process.
Create new folder in opt directory. In terminal type this command "sudo mkdir -p -v /opt/java/64".
Go to folder containing your JRE download file(example: use"cd Downloads" to move to Download directory from your home directory) and unpack the file by typing "tar xvzf YOUR JRE FILE".
Moved unpacked contents into system folder that you created in step1. Type "sudo mv -v YOUR JRE FILE /opt/java/64".
Inform the system and make the new JRE become your system default. - sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/YOUR EXTRACTED JRE FILE/bin/java" 1 - sudo update-alternatives --set java /opt/java/64/YOUR EXTRACTED JRE FILE/bin/java
Install Firefox plugins. Type "mkdir -v ~/.mozilla/plugins".
Removed IcedTea plugin, if it has been installed. type "sudo apt-get remove icedtea-6-plugin && sudo apt-get remove icedtea-7-plugin".
Remove an older version of the Java plugin. Type "rm -v ~/.mozilla/plugins/libnpjp2.so".
Install the plugin by creating symbolic link. Type "ln -s /opt/java/64/jre1.7.0_60/lib/amd64/libnpjp2.so ~/.mozilla/plugins/".
Close and restart Firefox
Type "about:plugins" in Firefox URL bar. If your installation is correct you will see something like this:
Veritrans is Indonesian Payment Gateway. Veritrans accepts Credit Card, Direct Debit, e-Wallet,Bank Transfer and Convenience Store. That's why this Payment Gateway is famous in Indonesia. Further explanations about Veritrans https://veritrans.co.id/ .
VT-Link facilitates a payment feature for your online store by redirecting the customer to Veritrans payment page through a link.
VT-Web
VT-Web facilitatess merchant to use Veritrans payment system, by redirecting the customer to the Veritrans payment page.
VT-Direct
VT-Direct is Veritrans product that allows you to use our payment system directly on your website
Integration Tool Kit
Rails 4
gem veritrans
Configurations
Add gem Veritrans to Gem File and bundle install
gem 'veritrans';
In Console generate veritrans.yml
rails g veritrans:install
Generate Veritrans Form
rails g veritrans:payment_form
This command will generate controller and view for Veritrans.
Because we will built dynamic key for this integrations. You can keep veritrans.yml configurations like this:
development:
# Register in sandbox veritrans and get your keys here:
# https://my.sandbox.veritrans.co.id/settings/config_info
client_key: ""
server_key: ""
api_host: ""
production:
# Register and get your keys here:
# https://my.veritrans.co.id/settings/config_info
client_key: ""
server_key: ""
api_host: ""
staging:
# Register and get your keys here:
# https://my.veritrans.co.id/settings/config_info
client_key: ""
server_key: ""
api_host: ""
Scripting
VT-Web Integrations
In VT-Web Integrations, you just need to obtain redirect URL to Veritrans . After last check out process, put this function for directing page to veritrans:
Rubycritic is gem that wraps around static analysis gems such as Reek, Flay and Flog to provide a quality report of your Ruby code.
Because this gem was uses as Audit guidelines code quality in my company, I often faced hard time to adjust, optimizing and refactor my code.
I began to summarize Rubycritic detecting behavior and implement it in my code to avoid Smells and easier get at least Grade C to bare pass.
A few my conclusion things to consider when developing code according Rubycritic :
Don't! Never! Avoid! Duplicity Code. Rubycritic love this think and will give you sudden great high score, enough to drop your Code Rating Grade.
Evade complicated nested logic with multiple if, switch, etc. It's saver to use functions to handle logic rather than nested logic. Fox example
// Rather than this
if obj == "a"
if obj1 == "1" && obj2 == "2"
// Process
elsif obj1 == "3" && obj2 == "4"
// Process
else
// Process
end
elsif obj1 == "b"
if obj1 == "1" && obj2 == "2"
// Process
elsif obj1 == "3" && obj2 == "4"
// Process
else
// Process
end
else
// Process
end
// Use this
if obj == "a"
process(obj1,obj2)
elsif obj1 == "b"
process(obj1,obj2)
else
// Process
end
Evade complicated nested loops with multiple each, for, etc. It's saver to use functions to handle loops rather than nested loops. Fox example
// Rather than this
data_sources.each do |data_source|
data_source.each do |data|
end
end
// Use This
data_sources.each do |data_source|
process(data_source)
end
If your function using nested hash, redeclare multiple used nested hash using variable.
// rather than
if params[:id] == '1'
user = User.where('id = ?',params[:id])
end
// Used This
id = params[:id]
if id == '1'
user = User.where('id = ?',id)
end