Vivek Garg

Open Source Enthusiast, Agile Practitioner, JavaScript Lover.

Javascript/Ajax/JQuery

JavaScript : String.slice() vs String.substring() vs String.substr()

In this blog, we will discuss about few methods that are used in JavaScript for partial string extraction. You can also see my blog specific on Arrays which are used in JavaScript. The following methods are :- slice() substring() substr() All these methods extracts parts of a string and returns the extracted parts in a...

19-Feb-2015

Javascript/Ajax/JQuery

JavaScript : Array.splice() vs Array.slice()

1. The splice() method returns the removed item(s) in an array and slice() method returns the selected element(s) in an array, as a new array object. 2. The splice() method changes the original array and slice() method doesn't change the original array. 3. The splice() method can take n number of arguments: Argument 1: Index,...

18-Feb-2015

Grails

Email Tracking using MailGun with Grails application

Many times we need to track whether the email is open/deliver/read by users, sent from our application. After analyzing, I concluded that MailGun provides email tracking services that i used with my grails application and thought it worth sharing. There are two ways to send messages using MailGun: #1. HTTP API #2. SMTP I have...

24-Jul-2014

Grails

Integrating Tumblr with grails application

In my current grails project, i needed to integrate Tumblr with the application using Tumblr API. I searched a lot about it and find the Java wrapper of Tumblr to use it with my grails application and thought it worth sharing. Tumblr uses OAuth1.0 protocol for authorization when our application tries to access the data. The steps...

13-Mar-2014

Grails

Groovy: Ways to represent String

Compared to Java we have a lot of  ways to represent strings : GString, single quote, double quotes, slashy and dollar slashy.   1.GString: A GString is just like a normal String, except that it evaluates expression that are embedded with in string in the form ${..}. [java] String...

02-Apr-2013

Grails

Groovy : tokenize() vs split()

The split() method returns a string [] instance and the  tokenize() method returns a list instance  tokenize() ,which returns a list, will ignore empty string (when a delimiter appears twice in  succession) where as split() keeps such string. [java] String testString = 'hello brother' assert testString.split() instanceof...

14-Mar-2013