OAuth 1 Signature – Rails + NETSUITE example

When we decide to use Oauth 1 for authentication, we need to answer the first question: ‘How is the signature generated?’. It took me 3 days to work it out before I could get data from our client’s NETSUITE account. I want to share with you my first raw Ruby code and hope it will save you a bit of time. Happy coding! References: https://developer.twitter.com/en/docs/authentication/oauth-1-0a/creating-a-signature

Rails API – Quick note

1. Setting up Rails 5 rails new api_app_name –api -d postgresql -T cd api_app_name bundle install rails db:setup Note: –api : generate API app only -d postgresql : using postgresql database -T : to skip generating Test because we are going to use RSpec for testing. 2. Using RSpec for testing group :development, :test do # Use RSpec for specs gem ‘rspec-rails’, ‘3.1.0’ # Use Factory Girl for generating random test data gem ‘factory_girl_rails’ end Read more…

Setup Ubuntu Server

After my server on DigitalOcean was attacked few times, I thought I should write an article about it. Do hope it is useful to you. Step One — Root Login $ ssh root@your_server_ip Step Two — Create a New User # adduser van Step Three — Root Privileges Set root privileges to new user. # usermod -aG sudo van Step Four — Add Public Key Authentication (Recommended) Generate a Key Pair You need to generate Read more…

How to Display an Animated gif in React Native

By default the Gif images are not supported in android react native app. You need to set the following code to display the gif images. Open your android/app/build.gradle file add the following code: open android/app/build.gradle add the following code dependencies: { … // For animated GIF support compile ‘com.facebook.fresco:animated-base-support:0.11.0’ // For WebP support, including animated WebP compile ‘com.facebook.fresco:animated-gif:0.11.0’ compile ‘com.facebook.fresco:animated-webp:0.11.0’ compile ‘com.facebook.fresco:webpsupport:0.11.0’ Then you need to bundle the app again. References: Image component stackoverflow.com

Install Atom Text Editor on Ubuntu 16.04

How to install Atom in Ubuntu via PPA: Webupd8 Team is maintaining an unofficial PPA with most recent Atom packages for all current Ubuntu releases, and derivatives. While official Linux binary is 64-bit only, the PPA supports both 32-bit and 64-bit. 1. Add PPA Open terminal (Ctrl+Alt+T) and run the command: $ sudo add-apt-repository ppa:webupd8team/atom 2. Update and install Atom editor: Update system package index and install the text editor via command: $ sudo apt Read more…