Skip to content

Instantly share code, notes, and snippets.

View marlonlom's full-sized avatar
😎

Marlon López marlonlom

😎
View GitHub Profile
@marlonlom
marlonlom / CustomBitmapDescriptorFactory.java
Last active March 13, 2023 13:05
This is a custom BitmapDescriptorFactory, prepared for converting color string (#cfer45) to its HUE form, and use it for Android Google Maps Marker coloring
package co.malm.android.utils.gms.maps.model;
import android.graphics.Color;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.BitmapDescriptor;
/**
* Custom {@link com.google.android.gms.maps.model.BitmapDescriptorFactory} Used to create a definition of an image,
* using HEX color strings as parameter, used for marker icons and ground overlays.
*
@marlonlom
marlonlom / ResultSetParserUtil.java
Last active February 27, 2024 11:07
A simple Java Utility for converting java.sql.ResultSet object and contents into some Output formats (JSON, XML) .
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import org.json.JSONArray;
import org.json.JSONObject;
/**
* Utility for converting ResultSets into some Output formats
*
* @author marlonlom
import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;
public class BalotoDummyDemo {
public static void main(String[] args) {
Random rand = new Random();
int max = 45;
int min = 1;
ArrayList<Integer> listNums = new ArrayList<Integer>(6);
/*
* Copyright 2014 Chris Banes
*
* 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
/*
* Copyright 2014 Chris Banes
*
* 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
package co.malm.demos.security.sha1;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* Utility class that uses {@link MessageDigest} for obtaining a hashed text
* using algorithms such as MD5 and SHA-1
*
/*
* Copyright 2014 Google Inc.
*
* 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
package com.github.manuelpeinado.toolbartest;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.View;
@marlonlom
marlonlom / CustomDateDiffExample.java
Last active August 29, 2015 14:18
Custom utility for date difference functionality, using a date string against current date. this method must be used following the pattern "EEE, dd MMM yyyy HH:mm:ss Z". but you can change this setting pattern values on utility class. Provided utility and demo. This utility was made using joda-time-2.7.jar
package co.malm.demos.datediff;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Locale;
import co.malm.demos.datediff.util.DateDiffUtil;
public class CustomDateDiffExample {
@marlonlom
marlonlom / EmptyRecyclerView.java
Last active September 7, 2015 20:41 — forked from mobiRic/EmptyRecyclerView.java
RecyclerView doesn't have an emptyView support, we gotta fix that
/*
* Copyright (C) 2015 Glowworm Software
* Copyright (C) 2014 Nizamutdinov Adel
*
* 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
*