Skip to content

Instantly share code, notes, and snippets.

Avatar

John Lombardo johnnylambada

View GitHub Profile
@SpaceBison
SpaceBison / SimpleJsonAdapter.kt
Created Sep 24, 2018
Moshi adapter for org.json objects
View SimpleJsonAdapter.kt
package com.n7mobile.loterity.network.moshi
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
HarryTylenol / AnkoRecyclerViewAdapter.kt
Last active Oct 30, 2019
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.setup(data[position])
holder.itemView.setOnClickListener {
@alexfu
alexfu / EqualSpacingItemDecoration.java
Last active Jul 27, 2021
Add equal spacing to RecyclerView items automatically. Can handle horizontal, vertical, and grid display modes
View EqualSpacingItemDecoration.java
import android.graphics.Rect;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
public class EqualSpacingItemDecoration extends RecyclerView.ItemDecoration {
private final int spacing;
private int displayMode;
public static final int HORIZONTAL = 0;
View My Exiftool Cheatsheet.md

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
avram / andevcon-gradle.html
Last active Aug 29, 2015
Gradle Automation - AnDevCon
View andevcon-gradle.html
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
@import url(http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(http://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(http://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
body {