Skip to content

Instantly share code, notes, and snippets.

@Sylyac2000
Sylyac2000 / file1.txt
Created Oct 17, 2020
the description for this gist
View file1.txt
String file contents
@Sylyac2000
Sylyac2000 / compact-child-routes
Created May 28, 2019 — forked from settermjd/compact-child-routes
Simple example of using child routes, using the Segment type, to keep a routing table in Zend Framework 2 simple and compact. For more information, check out http://www.masterzendframework.com/tutorial/child-and-segment-routes.
View compact-child-routes
return array(
'router' => array(
'routes' => array(
'forecaster' => array(
'type' => 'Literal',
'options' => array(
'route' => '/forecaster',
'defaults' => array(
'__NAMESPACE__' => 'Forecaster\Controller',
'controller' => 'Forecaster',
View country-dropdown-list.html
<select name="country">
<option>Afghanistan</option>
<option>Albania</option>
<option>Algeria</option>
<option>American Samoa</option>
<option>Andorra</option>
<option>Angola</option>
<option>Anguilla</option>
<option>Antarctica</option>
<option>Antigua and Barbuda</option>
View document-sharing-sites
https://www.alltechabout.com/document-sharing-sites/
View scroll constraint layout
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.constraint.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
View glideExample2.java
DrawableRequestBuilder drawableRequestBuilder = Glide.with(This
.load(url)
.fitCenter()
.animate(android.R.anim.fade_in);
if (mMediaFragmentListener.getLocalVideoUri() != null) {
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
Context context = getContext();
retriever.setDataSource(context, mMediaFragmentListener.getLocalVideoUri());
Bitmap frame = retriever.getFrameAtTime();
View rxJavaMultipleDownload.md

Using RxJava and Glide to download multiple GIFs

SOURCE

This guide is for RxJava 1 and Glide v3 (3.8.0).

Have a list of URLs to GIFs, how to download them all in separated threads and proceed when all GIFs are downloaded?

private void download(final List<String> urlList) {
View 1 basic
ARCHITECTURE COMPONENTS - I'M NOT A PURIST BUT ...
http://hannesdorfmann.com/android/arch-components-purist
DIFFERENT LIVEDATA AND OBSERABLE
LiveData seems to be a very simplified version of RxJava’s Observable. LiveData is lifecycle aware so that we as developer don’t have to unsubscribe explicitly as we have to do with RxJava’s Observable. Both implement the Observer pattern.
LiveData doesn’t provide all this fancy functional programming operators as RxJava does although architecture components provides some functional concepts via Transformations helper class such as Transformations.map() and Transformations.switchMap().
https://developer.android.com/topic/libraries/architecture/livedata.html
Unlike a regular observable, LiveData respects the lifecycle of app components, such that the Observer can specify a Lifecycle in which it should observe.
LiveData considers an Observer to be in an active state if the Observer’s Lifecycle is in STARTED or RESUMED state.
View links material design