This file contains 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 de.wdv.apps.yoursingapore.core.moshi | |
import com.squareup.moshi.JsonAdapter | |
import com.squareup.moshi.JsonReader | |
import com.squareup.moshi.JsonWriter | |
import com.squareup.moshi.Moshi | |
import de.wdv.apps.yoursingapore.core.realm.RealmIntArray | |
import de.wdv.apps.yoursingapore.core.realm.RealmLongArray | |
import de.wdv.apps.yoursingapore.core.realm.RealmStringArray | |
import java.lang.reflect.Type |
This file contains 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
<!-- Prevents TouchWiz from surrounding your app icon in a frame --> | |
<!-- Add to your manifest inside the application tag --> | |
<meta-data | |
android:name="com.samsung.android.icon_container.has_icon_container" | |
android:value="true"/> |
This file contains 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
val realmIntArrayType = object : TypeToken<RealmIntArray>() {}.type | |
val realmLongArrayType = object : TypeToken<RealmLongArray>() {}.type | |
val realmStringArrayType = object : TypeToken<RealmStringArray>() {}.type | |
val gson = GsonBuilder() | |
.setExclusionStrategies(object : ExclusionStrategy { | |
override fun shouldSkipClass(clazz: Class<*>?): Boolean { | |
return false | |
} | |
override fun shouldSkipField(f: FieldAttributes?): Boolean { |
This file contains 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
class GetPosts @Inject constructor( | |
uiExecutor: UiExecutor, | |
@Named("ioExecutor") backgroundExecutor: BackgroundExecutor, | |
private val redditRepository: RedditRepository | |
) : ReactiveUseCase<List<RedditLink>>(uiExecutor, backgroundExecutor) { | |
fun execute(onNext: (List<RedditLink>) -> Unit, | |
onError: (Throwable) -> Unit, | |
onCompleted: () -> Unit) { |
This file contains 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 AndroidApplication extends MultiDexApplication { | |
public static final String TAG = AndroidApplication.class.getSimpleName(); | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
registerComponentCallbacks(new ComponentCallback()); | |
} | |
private class ComponentCallback implements ComponentCallbacks2 { |
This file contains 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
#!/usr/bin/env ruby | |
# Usage: dedup-imovie-library LIBRARY ORIGINALS | |
# | |
# Goes through an iMovie 10 library and replaces all the "Original Media" with | |
# symlinks to the actual original media, in order to conserve disk space. Note | |
# that because they're symlinks, if the path to the originals changes (e.g. you | |
# rename the external drive they are on) then the links will be broken. | |
# | |
# This assumes you've already imported the files into iMovie and waited for them |
This file contains 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
extension DataRequest{ | |
/// @Returns - DataRequest | |
/// completionHandler handles JSON Object T | |
@discardableResult func responseObject<T: Decodable> ( | |
queue: DispatchQueue? = nil , | |
completionHandler: @escaping (DataResponse<T>) -> Void ) -> Self{ | |
let responseSerializer = DataResponseSerializer<T> { request, response, data, error in | |
guard error == nil else {return .failure(BackendError.network(error: error!))} | |
This file contains 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 android.app.Activity | |
import android.app.Dialog | |
import android.content.Context | |
import android.view.View | |
import androidx.fragment.app.Fragment | |
import androidx.test.platform.app.InstrumentationRegistry | |
import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation | |
import com.facebook.testing.screenshot.Screenshot | |
import com.facebook.testing.screenshot.ViewHelpers |
This file contains 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
javascript:(function(){var styles = document.querySelectorAll('link[rel=\'stylesheet\']'); for (var s = 0; s < styles.length; s++) {styles[s].mediax = styles[s].media;if (styles[s].media === 'only x') { styles[s].media = styles[s].mediax; } else if (styles[s].media !== 'print') {styles[s].media = 'only x';}}})(); |
This file contains 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
extension URLRequest { | |
public func curl(pretty:Bool = false) -> String { | |
var data : String = "" | |
let complement = pretty ? "\\\n" : "" | |
let method = "-X \(self.httpMethod ?? "GET") \(complement)" | |
let url = "\"" + self.url?.absoluteString ?? "" + "\"" | |
var header = "" |
OlderNewer