Skip to content

Instantly share code, notes, and snippets.

@droidchef
droidchef / LTransformPlugin.kt
Last active April 5, 2022 23:34
Transform Plugin to add functionality to a Fragment class
import com.android.SdkConstants
import com.android.build.api.transform.*
import com.android.build.gradle.BaseExtension
import com.android.build.gradle.internal.plugins.AppPlugin
import com.android.build.gradle.internal.plugins.LibraryPlugin
import javassist.ClassPool
import org.apache.commons.io.FileUtils
import org.apache.commons.io.IOUtils
import org.gradle.api.Plugin
import org.gradle.api.Project
@droidchef
droidchef / LinkedInAutocoment.js
Created March 21, 2019 11:03 — forked from techguybiswa/LinkedInAutocoment.js
Automatically reply to ALL your LinkedIn Comments
var listOfCommentBox = document.getElementsByTagName("article");
//get the array list of all the div-s that has the comments
let extractedListOfFirstComment = [];
// store the author details of the comment
let listOfDiv = [];
//store the div-s of the comment
let count =0;
function generateComment(name,index) {
/* Copyright 2013 Google Inc.
Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0.html */
package com.example.latlnginterpolation;
import android.animation.ObjectAnimator;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.os.Build;
@droidchef
droidchef / commit.sh
Created June 2, 2016 13:27
save this file in your /bin which is in your path. So that you can use it from your command line as $commit feat
#!/bin/sh
TYPE=$1
if [ "$TYPE" == "feat" ]; then
MESSAGE="a new feature"
elif [ "$TYPE" == "fix" ]; then
MESSAGE="a bug fix"
elif [ "$TYPE" == "docs" ]; then
MESSAGE="changes to documentation"
elif [ "$TYPE" == "style" ]; then
MESSAGE="formatting, missing semi colons, etc; no code change"
@droidchef
droidchef / GeoLocationProviderTest.java
Created March 13, 2015 05:46
GeoLocationProviderTest not able to get past it.
public class GeoLocationProviderTest extends InitExtensions{
@Test
public void testGeoLocationProvider() throws Exception{
// @formatter:off
final String geoLocationString =
"<iq type='get' id='publish1'>"
+ "<pubsub xmlns='http://jabber.org/protocol/pubsub'>"
+ "<publish node='http://jabber.org/protocol/geoloc'>"
+ "<item>"
@droidchef
droidchef / gist:634fdcc05e09f19287d9
Created June 20, 2014 10:26
Snippet for Toggle TextView to Show and Hide ListView for Savings and Loan Accounts Alternatively.
final String loanAccountsStringResource = getResources().getString(R.string.loanAccounts);
final String savingsAccountsStringResource = getResources().getString(R.string.savingAccounts);
final String loanListOpen = "- " + loanAccountsStringResource;
final String loanListClosed = "+ " + loanAccountsStringResource;
final String savingsListOpen = "- " + savingsAccountsStringResource;
final String savingsListClosed = "+ " + savingsAccountsStringResource;
if (clientAccounts.getLoanAccounts().size() > 0) {
LoanAccountsListAdapter loanAccountsListAdapter =
new LoanAccountsListAdapter(getActivity().getApplicationContext(), clientAccounts.getLoanAccounts());