Skip to content

Instantly share code, notes, and snippets.

/**
* Signal the apollo client to fetch the data from both the network and the cache. If cached data is not present, only
* network data will be returned. If cached data is available, but network experiences an error, only cached data is
* returned. If cache data is not available, and network data is not available, the error
* of the network request will be propagated. If both network and cache are available, both will be returned. Cache data
* is guaranteed to be returned first.
*
* Modified from Apollo's CacheAndNetworkFetcher
* https://github.com/apollographql/apollo-android/blob/f72c3afd17655591aca90a6a118dbb7be9c50920/apollo-runtime/src/main/java/com/apollographql/apollo/internal/fetcher/CacheAndNetworkFetcher.java#L1
*/
@davidalbers
davidalbers / .vimrc
Last active November 22, 2016 22:41
syntax on
set background=dark
highlight Comment ctermfg=darkgray
set ic
set number
set laststatus=2
hi StatusLine ctermfg=Black ctermbg=Yellow
xnoremap p pgvy
@davidalbers
davidalbers / TextOverAVRCP.java
Created September 4, 2015 18:39
Example for sending text over AVRCP from an Android application.
/**
* Generalized code from botifier, source code at https://github.com/grimpy/Botifier
* Provides example methods for sending text over AVRCP from an Android application.
* AVRCP is the Bluetooth protocol your phone uses to send song information to your car stereo/smartwatch.
* Only for Android 5.0+
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
//in activity or service