Skip to content

Instantly share code, notes, and snippets.

@stackoverflows
stackoverflows / VolleyImageWrapper.java
Last active December 23, 2015 06:49
Volley Image Wrapper used with standard Android ImageViews ( android.widget.ImageView)
package com.example.exampleapp;
import android.widget.ImageView;
import com.android.volley.RequestQueue;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.ImageLoader.ImageContainer;
public final class VolleyImageWrapper {
@stackoverflows
stackoverflows / luhn_check.php
Last active June 22, 2018 10:13
Working PHP Credit Card luhn check (preliminary credit card number validation)
// will update with suggestions
function luhnCheck($number): bool
{
$number = preg_replace("/[^0-9]/", "", strval($number)); // convert to string and remove non numeric characters
$sum = "";
$revNumber = strrev($number);
$len = strlen($number);
for ($i = 0; $i < $len; $i++) {