Skip to content

Instantly share code, notes, and snippets.

View DBHelper.java
/**
* 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;
View gist:5dc8271fb4986adb8878a9cdac93ada7
/**
* @param fromDate
* @return
*/
public static String getDateDiffPastInDays(Long fromDate) {
Date currentDate = new Date();
if (currentDate.getTime() <= fromDate) {
return "";
} else {
@riyazMuhammad
riyazMuhammad / CustomItemClickListener.java
Last active Dec 30, 2020
Easy Implementation of RecyclerView custom onItemClickListener
View CustomItemClickListener.java
public interface CustomItemClickListener {
public void onItemClick(View v, int position);
}
View CircleTransform.java
/*
* 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 Aug 29, 2015
Image Resize Snippet for PHP
View ImageResize.php
<?php
Class ImageResize {
// *** Class variables
private $image;
private $width;
private $height;
function __construct($fileName) {