Skip to content

Instantly share code, notes, and snippets.

@mislavs
mislavs / BooksAdapter
Created October 29, 2014 19:58
RecyclerView.Adapter implementation for displaying a list of Book objects.
package com.msvs.bookshelf.adapters;
import android.os.Handler;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
@mislavs
mislavs / RestClient
Created October 29, 2014 20:04
Simple REST Client implementation using Retrofit. Interfaces are declared in the GoogleBooksInterfaces file.
package com.msvs.bookshelf.retrofit;
import com.msvs.bookshelf.events.BookFoundEvent;
import com.msvs.bookshelf.model.entities.Author;
import com.msvs.bookshelf.model.entities.Book;
import com.msvs.bookshelf.model.entities.Category;
import com.msvs.bookshelf.retrofit.model.Item;
import com.msvs.bookshelf.retrofit.model.QueryResult;
import java.util.ArrayList;
@mislavs
mislavs / GoogleBooksInterfaces
Created October 29, 2014 20:05
Interface declaration for a REST client implementation using Retrofit.
package com.msvs.bookshelf.retrofit;
import com.msvs.bookshelf.retrofit.model.QueryResult;
import retrofit.Callback;
import retrofit.http.GET;
import retrofit.http.Query;
public class Interfaces {
@mislavs
mislavs / activity_book_details_activity_data_binding_demo.xml
Created June 14, 2015 12:37
Android databinding library demo layout file - displays book cover and details.
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="com.msvs.bookshelf.fragments.BookDetailsFragment">
<data>
<variable
name="book"
@mislavs
mislavs / BookDetailsActivityDataBindingDemo.java
Created June 14, 2015 12:41
Book details activity using the databinding library.
package com.msvs.bookshelf.activities;
import android.databinding.BindingAdapter;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
import com.msvs.bookshelf.R;
import com.msvs.bookshelf.databinding.ActivityBookDetailsActivityDataBindingDemoBinding;
@mislavs
mislavs / GenericRepository.cs
Created July 30, 2021 09:14
Generic Repository implementation
using FileSystem.Data.Interfaces;
using FileSystem.Data.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
@mislavs
mislavs / AddNullableDisablePragma.ps1
Created January 11, 2022 11:58
Adds the nullable disable pragma to every child .cs file
Get-ChildItem $PWD -Filter *.cs -Recurse |
Where-Object {$_.FullName -notlike "*\bin\*" -and $_.FullName -notlike "*\obj\*" -and $_.FullName -notlike "*\Migrations\*"} |
Foreach-Object{
$content = Get-Content $_.FullName
Set-Content $_.FullName -value "#nullable disable", $content
}
@mislavs
mislavs / .NET6Migration.md
Created February 14, 2023 12:54 — forked from davidfowl/.NET6Migration.md
.NET 6 ASP.NET Core Migration