Skip to content

Instantly share code, notes, and snippets.

Marlon José López Meza marlonlom

Block or report user

Report or block marlonlom

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@marlonlom
marlonlom / RecyclerViewItemTouchListener.java
Created Dec 3, 2018 — forked from RanyAlbegWein/RecyclerViewItemTouchListener.java
A helper class for handling click events on a RecyclerView
View RecyclerViewItemTouchListener.java
/**
* Created by Rany Albeg Wein on 07/11/2015.
* Since we currently don't have a LongItemClick listener for the {@link RecyclerView}
* this is an implementation that uses a {@link GestureDetector} to notify us for long click events on one of
* {@link RecyclerView}'s child views. It also handles single-tap-up ( a click ) and a double-click on a child view.
*/
public class RecyclerViewItemTouchListener extends RecyclerView.SimpleOnItemTouchListener {
/**
* A listener that will be invoked on item click events.
@marlonlom
marlonlom / google_staticmaps_router.js
Last active Jan 26, 2018
Google staticmaps Router implementation. Used for map images downloading using Nodejs + ExpressJS
View google_staticmaps_router.js
/**
* Google staticmaps Router implementation.
*/
const express = require('express'),
request = require('request'),
router = express.Router(),
StaticMaps = {
baseHost: "https://maps.googleapis.com/maps/api"
};
@marlonlom
marlonlom / slugify.js
Created Nov 20, 2017 — forked from codeguy/slugify.js
Create slug from string in Javascript
View slugify.js
function string_to_slug (str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}
@marlonlom
marlonlom / uuid.demo.js
Created Nov 20, 2017
Gist for javascript function that creates universally unique identifier (UUID), which is a 128-bit number used to identify information in computer systems.
View uuid.demo.js
console.log(uuid());
@marlonlom
marlonlom / Aes128EncryptionCompat.java
Last active Oct 2, 2017
AES 128bit Cross Platform (Java) Encryption Compatibility
View Aes128EncryptionCompat.java
/*
* Copyright (c) 2017, marlonlom
*
* 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,
View MiddleNumber.java
public class MiddleNumber
{
public static void main(String[] args)
{
MiddleNumber myObject = new MiddleNumber();
int[] numberz = {1,2,4,60,8,20};
int[] resultz= myObject.makeMiddle(numberz);
System.out.print("myObject.makeMiddle: "+resultz[0]);
}
@marlonlom
marlonlom / Preferences.java
Last active Jul 23, 2017
Gist for Preferences.java, Utility class for handling read/write operations using SharedPreferences
View Preferences.java
/*
* Copyright (c) 2017, marlonlom
*
* 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,
@marlonlom
marlonlom / error-uploading-mvn.txt
Created Jun 21, 2016
build failed when uploading archives
View error-uploading-mvn.txt
Could not transfer artifact com.github.marlonlom:staticmaps-builder:aar:1.0.0 from/to remote (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Access denied to: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/marlonlom/staticmaps-builder/1.0.0/staticmaps-builder-1.0.0.aar, ReasonPhrase: Forbidden.
Could not transfer artifact com.github.marlonlom:staticmaps-builder:pom:1.0.0 from/to remote (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Access denied to: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/marlonlom/staticmaps-builder/1.0.0/staticmaps-builder-1.0.0.pom, ReasonPhrase: Forbidden.
Could not transfer artifact com.github.marlonlom:staticmaps-builder:jar.asc:javadoc:1.0.0 from/to remote (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Access denied to: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/marlonlom/staticmaps-builder/1.0.0/staticmaps-builder-1.0.0-javadoc.jar.asc, ReasonPhras
@marlonlom
marlonlom / simple-pagination.js
Created Apr 7, 2016 — forked from kottenator/simple-pagination.js
Simple pagination algorithm
View simple-pagination.js
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@marlonlom
marlonlom / LatLngConverter.java
Created Oct 1, 2015
LatLngConverter: Utility class for converting a coordinate into its DMS (degrees, minutes, seconds) representation, for information visualization of coordinates
View LatLngConverter.java
package co.marlonlom.demos.latlng.converters;
/**
* Utility class for converting a coordinate into its DMS (degrees, minutes,
* seconds) representation
*
* @author marlonlom
*/
public final class LatLngConverter {
/**
You can’t perform that action at this time.