- Introduction to Functional Programming Johannes Weiß - https://vimeo.com/100786088
- ReactiveCocoa at MobiDevDay Andrew Sardone - https://vimeo.com/65637501
- The Future Of ReactiveCocoa Justin Spahr-Summers - https://www.youtube.com/watch?v=ICNjRS2X8WM
- Enemy of the State Justin Spahr-Summers - https://www.youtube.com/watch?v=7AqXBuJOJkY
- WWDC 2014 Session 229 - Advanced iOS Application Architecture and Patterns Andy Matuschak - https://developer.apple.com/videos/play/wwdc2014/229/
- Functioning as a Functionalist Andy Matuschak - https://www.youtube.com/watch?v=rJosPrqBqrA
- Controlling Complexity in Swift Andy Matuschak - https://realm.io/news/andy-matuschak-controlling-complexity/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun <T> Flow<T>.throttle(waitMillis: Int) = flow { | |
| coroutineScope { | |
| val context = coroutineContext | |
| var nextMillis = 0L | |
| var delayPost: Deferred<Unit>? = null | |
| collect { | |
| val current = SystemClock.uptimeMillis() | |
| if (nextMillis < current) { | |
| nextMillis = current + waitMillis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.rzagorski.coordinatorawareautocompletetextviewapp; | |
| import android.content.Context; | |
| import android.support.annotation.Nullable; | |
| import android.support.design.widget.CoordinatorLayout; | |
| import android.support.design.widget.Snackbar; | |
| import android.support.v7.widget.AppCompatAutoCompleteTextView; | |
| import android.util.AttributeSet; | |
| import android.view.View; | |
| import android.view.ViewGroup; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CustomLayout extends LinearLayout { | |
| @SuppressWarnings("unchecked") @Override public Parcelable onSaveInstanceState() { | |
| Parcelable saveInstanceState = super.onSaveInstanceState(); | |
| SavedState savedState = new SavedState(saveInstanceState); | |
| savedState.childrenStates = new SparseArray(); | |
| for (int i = 0; i < getChildCount(); i++) { | |
| getChildAt(i).saveHierarchyState(savedState.childrenStates); | |
| } | |
| return savedState; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * This would be the activity which registers the receiver class via it's interface | |
| */ | |
| public class MainActivity implements NetworkStateReceiver.NetworkStateReceiverListener { | |
| private NetworkStateReceiver networkStateReceiver; // Receiver that detects network state changes | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| /***/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.furkantektas.braingames.ui; | |
| import android.content.Context; | |
| import android.content.res.TypedArray; | |
| import android.support.v7.widget.CardView; | |
| import android.util.AttributeSet; | |
| import com.furkantektas.braingames.R; | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.HashMap; | |
| import java.util.LinkedHashMap; | |
| import java.util.Map; | |
| import android.os.SystemClock; | |
| public class TimeExpiringLruCache<K, V> { | |
| private final LinkedHashMap<K, V> map; | |
| private final HashMap<K, Long> validityTime; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Remove the history from | |
| rm -rf .git | |
| -- recreate the repos from the current content only | |
| git init && git add . && git status | |
| git commit -m "Initial commit" | |
| -- push to the github remote repos ensuring you overwrite history | |
| git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git | |
| git push -u --force origin master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| abstract class RadioAdapter<T> extends RecyclerView.Adapter<RadioAdapter.ViewHolder> { | |
| public int mSelectedItem = -1; | |
| private Context mContext; | |
| private List<T> mItems; | |
| public RadioAdapter(Context context, List<T> items) { | |
| mContext = context; | |
| mItems = items; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // H/t to https://github.com/ethankhall/scripts/blob/master/gradle/find-file.gradle for the idea; | |
| // this re-written version actually works in modern Gradle and Android Gradle plugins. | |
| task findInDependencies << { | |
| println() | |
| def resolvableConfigs = project.getConfigurations() | |
| .stream() | |
| .filter { it.isCanBeResolved() } |
NewerOlder