I hereby claim:
- I am sagrawal31 on github.
- I am shagrawal (https://keybase.io/shagrawal) on keybase.
- I have a public key ASBdggAw-it7HVnymLwArRHY_FbcbMmbH6ikz2jt8RRh8Ao
To claim this, I am signing this object:
| import java.util.regex.Matcher | |
| import java.util.regex.Pattern | |
| Pattern urlPattern = Pattern.compile("\\b(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]",Pattern.CASE_INSENSITIVE); | |
| String urlString = """This is a big string with lots of Image URL like: http://i.istockimg.com/file_thumbview_approve/69656987/3/stock-illustration-69656987-vector-of-flat-icon-life-buoy.jpg and | |
| http://i.istockimg.com/file_thumbview_approve/69943823/3/stock-illustration-69943823-beach-ball.jpg few others below | |
| http://i.istockimg.com/file_thumbview_approve/40877104/3/stock-photo-40877104-pollen-floating-on-water.jpg | |
| http://i.istockimg.com/file_thumbview_approve/68944343/3/stock-illustration-68944343-ship-boat-flat-icon-with-long-shadow.jpg | |
| """ |
| /** | |
| * Must have copyright statement either of the company or of our client. | |
| * Follow other files in the repository. | |
| */ | |
| package com.wp.test // package declaration just after copyright statement | |
| // One line space after package declaration | |
| // Import statement must be organized. Use organize tool in GGTS | |
| import java.text.DateFormat |
| import java.util.concurrent.TimeUnit | |
| void convert(int secondsToConvert) { | |
| long millis = secondsToConvert * 1000; | |
| long hours = TimeUnit.MILLISECONDS.toHours(millis); | |
| long minutes = TimeUnit.MILLISECONDS.toMinutes(millis) % TimeUnit.HOURS.toMinutes(1); | |
| long seconds = TimeUnit.MILLISECONDS.toSeconds(millis) % TimeUnit.MINUTES.toSeconds(1); | |
| String format = String.format("%02d:%02d:%02d", Math.abs(hours), Math.abs(minutes), Math.abs(seconds)); | |
| #!/usr/bin/env bash | |
| set -e | |
| # Handy script to auto use the Grails 3 version based on what is defined in the "gradle.properties". This script uses | |
| # the Grails installed by the famous SDKMan so it will look the Grails installation at "~/.sdkman/candidates/grails" | |
| # so only make sure the particular Grails version is installed using "sdk install grails <version>". | |
| # | |
| # The only thing to care about is that this script should be included first in the "PATH" before the | |
| # ".sdkman/candidates/grails/current" is included. | |
| # |
| import groovy.io.FileType | |
| File fooDirectory = new File("/some-path-to-the-parent-directory") | |
| // Recurse only *.html file (for example) | |
| def reportNamePattern = ~/.*\.html/ | |
| fooDirectory.eachFileMatch(FileType.FILES, reportNamePattern) { File myFile -> | |
| // Use myFile as you want | |
| println myFile.name | |
| } |
| #!/bin/bash | |
| ### BEGIN INIT INFO | |
| # Provides: tomcat7 | |
| # Required-Start: $network | |
| # Required-Stop: $network | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Start/Stop Tomcat server | |
| ### END INIT INFO |
I hereby claim:
To claim this, I am signing this object:
| URL getFinalURL(String url) { | |
| getFinalURL(new URL(url)) | |
| } | |
| URL getFinalURL(URL url) { | |
| HttpURLConnection connection = (HttpURLConnection) url.openConnection() | |
| connection.setInstanceFollowRedirects(false) | |
| connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36") | |
| connection.addRequestProperty("Accept-Language", "en-US,en;q=0.8") | |
| connection.addRequestProperty("Referer", "http://example.com/") |
| import liquibase.statement.core.UpdateStatement | |
| databaseChangeLog = { | |
| // Some other changeSets | |
| changeSet(author: "Shashank (generated)", id: "1381499382647-13") { | |
| addColumn(tableName: "ufile") { | |
| column(name: "file_group", type: "varchar(255)") { | |
| constraints(nullable: "false") |
| import liquibase.statement.core.InsertStatement | |
| databaseChangeLog = { | |
| changeSet(author: "Shashank Agrawal", id: "my-custom-unique-id-for-each-changeSet-11212013-1") { | |
| grailsChange { | |
| change { | |
| def statements = [] |