DatabaseOpenHelper.java
// Copyright 2015 Achilles Rasquinha
// 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
// For details, see | |
// http://stackoverflow.com/questions/40261857/remove-nested-key-from-dictionary | |
import Foundation | |
extension Dictionary { | |
subscript(keyPath keyPath: String) -> Any? { | |
get { | |
guard let keyPath = Dictionary.keyPathKeys(forKeyPath: keyPath) | |
else { return nil } | |
return getValue(forKeyPath: keyPath) |
var test = [0, 1] | |
extension MutableCollection { | |
mutating func updateEach(_ update: (inout Element) -> Void) { | |
for i in indices { | |
update(&self[i]) | |
} | |
} | |
} |
#Cleanup your Gradle caches by deleting files not accessed within the last month | |
find ~/.gradle -type f -atime +30 -delete | |
find ~/.gradle -type d -mindepth 1 -empty -delete | |
#!/bin/bash | |
open -a "/Applications/Google Chrome.app" https://www.youtube.com/watch?v=BYwqjCj6kgc |
// GSON can parse the data. | |
// | |
// Deserialization: | |
// Note there is a bug in GSON 2.3.1 that can cause it to StackOverflow when working with RealmObjects. | |
// To work around this, use the ExclusionStrategy below or downgrade to 1.7.1 | |
// See more here: https://code.google.com/p/google-gson/issues/detail?id=440 | |
// | |
// Serialization: | |
// <Type>RealmProxy objects are created by the Realm annotation processor. They are used to control | |
// access to the actual data instead of storing them in fields and it is therefore them we need to register a |
import android.app.Activity; | |
import android.app.Service; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.os.Bundle; | |
import android.os.IBinder; | |
import android.support.v4.content.LocalBroadcastManager; |
package net.kristopherjohnson.util; | |
import java.text.DateFormat; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.Locale; | |
import java.util.TimeZone; | |
/** | |
* Methods for dealing with timestamps |
package jieqoo.android.KASS.test.tasks; | |
import java.util.concurrent.CountDownLatch; | |
import java.util.concurrent.TimeUnit; | |
import jieqoo.android.models.RESTListener; | |
import jieqoo.android.models.RESTResponse; | |
import jieqoo.android.tasks.FetchRESTResponseTask; | |
import jieqoo.android.util.Configuration; | |
import android.test.InstrumentationTestCase; |
import android.content.Context; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import org.jetbrains.annotations.NotNull; | |
import org.jetbrains.annotations.Nullable; | |
public class EmptyRecyclerView extends RecyclerView { | |
@Nullable View emptyView; |