Skip to content

Instantly share code, notes, and snippets.

View preethamhegdes's full-sized avatar

Preetham Hegde preethamhegdes

View GitHub Profile
@preethamhegdes
preethamhegdes / Oauth1SigningInterceptor.java
Created December 31, 2018 09:09 — forked from JakeWharton/Oauth1SigningInterceptor.java
An OkHttp interceptor which does OAuth1 signing. Requires Guava and Java 8, although those dependencies wouldn't be too hard to break if you didn't have them.
/*
* Copyright (C) 2015 Jake Wharton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@preethamhegdes
preethamhegdes / intellijidea-chaning-method-setter.md
Last active August 5, 2017 04:51
Method chaining template for IntelliJ IDEA - POJO setter method
#set($paramName = $helper.getParamName($field, $project))
#if($field.modifierStatic)
static ##
#end
$classname set$StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project)))($field.type $paramName) {
  #if ($field.name == $paramName)
    #if (!$field.modifierStatic)
      this.##
 #else
@preethamhegdes
preethamhegdes / OkHttpUtil.java
Last active June 24, 2024 06:38
OkHttp Client Ignore certificate
import okhttp3.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.net.ssl.*;
import java.net.*;
import java.security.cert.CertificateException;
/*
okhttp version used 3.8.1
@preethamhegdes
preethamhegdes / databaseConnectionValidationQuery.md
Last active July 9, 2017 09:40
Database Connection validation query
#!/bin/bash
# https://gist.github.com/preethamhegdes/1c37aab26104136ff517
# Disclaimer - make backups, use at your own risk.
# Updated version of gist : https://gist.github.com/tadas-s/5411299
# Based on this comment: http://stackoverflow.com/a/13944924/843067
# Views and stored procedures have to be done separately.
#Note : Please configure mysql username and password properly (Line number 17)