Skip to content

Instantly share code, notes, and snippets.

@sahujaunpuri
sahujaunpuri / ReadWriteExcelFile.java
Created August 10, 2018 08:40 — forked from madan712/ReadWriteExcelFile.java
Read / Write Excel file (.xls or .xlsx) using Apache POI
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@sahujaunpuri
sahujaunpuri / Code.gs
Created October 6, 2018 22:10 — forked from adborden/Code.gs
Turn google spreadsheet into a JSON API
function doGet(request)
{
var spreadsheetId = 'YOUR SPREADSHEET ID HERE';
var sheetId = request.parameters.sheet || 0;
// Get data from the sheet
var sheet = getSheet(spreadsheetId, sheetId);
var dataArray = getData(sheet);
// Normalize the headers
@sahujaunpuri
sahujaunpuri / PayTM.java
Created October 24, 2018 14:00 — forked from pavi2410/PayTM.java
PayTM payments extenstion for App Inventor
package com.pavitra;
import android.app.Activity;
import android.util.Log;
import android.content.Context;
import android.widget.Toast;
import com.paytm.pgsdk.PaytmOrder;
import com.paytm.pgsdk.PaytmPGService;
import com.paytm.pgsdk.PaytmPaymentTransactionCallback;
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
/*
Copyright 2011 Martin Hawksey
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
@sahujaunpuri
sahujaunpuri / PdfPrint.java
Created February 3, 2019 22:23 — forked from brettwold/PdfPrint.java
How to save a PDF from any Android WebView
package android.print;
import android.os.CancellationSignal;
import android.os.ParcelFileDescriptor;
import android.util.Log;
import java.io.File;
public class PdfPrint {
@sahujaunpuri
sahujaunpuri / Connectivity.java
Created March 12, 2019 20:53 — forked from emil2k/Connectivity.java
Android utility class for checking device's network connectivity and speed.
/*
* Copyright (c) 2017 Emil Davtyan
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@sahujaunpuri
sahujaunpuri / Locator.java
Created March 12, 2019 20:57 — forked from emil2k/Locator.java
Android utility class for getting device location using various methods. Depends on `Connectivity` class found here: https://gist.github.com/emil2k/5130324
/*
* Copyright (c) 2017 Emil Davtyan
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@sahujaunpuri
sahujaunpuri / added_perm.csv
Created March 17, 2019 15:07 — forked from kalharbi/added_perm.csv
Added Permissions
permission count
android.permission. 2.0
android.permission.ACCESOFS_WIFI_STATE 1.0
android.permission.ACCESS_ASSISTED_GPS 7.0
android.permission.ACCESS_BACKGROUND_SERVICE 2.0
android.permission.ACCESS_CELL_ID 2.0
android.permission.ACCESS_CHECKIN_PROPERTIES 4.0
android.permission.ACCESS_COARSE_LOCATION 1114.0
android.permission.ACCESS_COARSE_UPDATES 7.0
android.permission.ACCESS_CORSE_LOCATION 1.0
@sahujaunpuri
sahujaunpuri / database.rules.json
Created September 14, 2019 06:40 — forked from codediodeio/database.rules.json
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}