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) |
// 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; |
import android.graphics.Bitmap; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.graphics.drawable.Drawable; | |
import java.io.ByteArrayOutputStream; | |
/** | |
* Sketch Project Studio | |
* Created by Angga on 12/04/2016 14.27. | |
*/ | |
public class AppHelper { |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
import UIKit | |
import XCPlayground | |
class ViewController: UIViewController { | |
func action() { print("Bing!") } | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
view.backgroundColor = .whiteColor() | |