Skip to content

Instantly share code, notes, and snippets.

View riyazMuhammad's full-sized avatar

Muhammad Riyaz riyazMuhammad

View GitHub Profile
@riyazMuhammad
riyazMuhammad / CustomItemClickListener.java
Last active December 30, 2020 15:10
Easy Implementation of RecyclerView custom onItemClickListener
public interface CustomItemClickListener {
public void onItemClick(View v, int position);
}
/**
* Database helper. All database (sqlite) calls can go in here
*
* @author Muhammad Riyaz
*
*/
public class DBHelper {
private static final String DB_NAME = "db_name";
private static final int DB_VER = 1;
https://hykm.test-app.link/iOsqT4A3oM
/**
* @param fromDate
* @return
*/
public static String getDateDiffPastInDays(Long fromDate) {
Date currentDate = new Date();
if (currentDate.getTime() <= fromDate) {
return "";
} else {
/*
* Copyright 2014 Julian Shen
*
* 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
@riyazMuhammad
riyazMuhammad / ImageResize.php
Last active August 29, 2015 14:23
Image Resize Snippet for PHP
<?php
Class ImageResize {
// *** Class variables
private $image;
private $width;
private $height;
function __construct($fileName) {