Skip to content

Instantly share code, notes, and snippets.


John Lombardo johnnylambada

View GitHub Profile
SpaceBison / SimpleJsonAdapter.kt
Created Sep 24, 2018
Moshi adapter for org.json objects
View SimpleJsonAdapter.kt
import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.JsonReader
import com.squareup.moshi.JsonReader.Token.END_ARRAY
import com.squareup.moshi.JsonReader.Token.END_OBJECT
import com.squareup.moshi.JsonWriter
import org.json.JSONArray
import org.json.JSONObject
HarryTylenol / AnkoRecyclerViewAdapter.kt
Last active Apr 11, 2022
Make RecyclerView with Anko Like Pro
View AnkoRecyclerViewAdapter.kt
abstract class AnkoRecyclerViewAdapter<Model : Any, AnkoView : AnkoComponent<ViewGroup>, ViewHolder : RecyclerView.ViewHolder> : RecyclerView.Adapter<ViewHolder>() {
abstract val data: List<Model> // Data list
abstract val ankoView: AnkoView // Layout as AnkoComponent<ViewGroup>
abstract fun ViewHolder.setup(model: Model) // setup model from ViewHolder
abstract val onItemClickListenerUnit: (Model) -> Unit // Item Click Listener
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.itemView.setOnClickListener {
alexfu /
Last active Dec 28, 2022
Add equal spacing to RecyclerView items automatically. Can handle horizontal, vertical, and grid display modes
import android.view.View;
public class EqualSpacingItemDecoration extends RecyclerView.ItemDecoration {
private final int spacing;
private int displayMode;
public static final int HORIZONTAL = 0;
alonisser / iptables-persistent no input
Last active Nov 11, 2022
Installing iptables-persistent on ubuntu without manual input
View iptables-persistent no input
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
sudo apt-get -y install iptables-persistent
View My Exiftool

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

avram / andevcon-gradle.html
Last active Aug 29, 2015
Gradle Automation - AnDevCon
View andevcon-gradle.html
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
@import url(;
@import url(,700,400italic);
@import url(,700,400italic);
body {