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
| theme = GitHub Dark Default | |
| macos-icon = retro |
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 os | |
| private let subsystem = "<ENTER-YOUR-SUBSYSTEM-STRING-HERE>" | |
| // MARK: - Protocol | |
| protocol LogProducer { | |
| func debug(_ message: StaticString, _ messageArguments: CVarArg...) | |
| func info(_ message: StaticString, _ messageArguments: CVarArg...) | |
| func warn(_ message: StaticString, _ messageArguments: CVarArg...) |
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 android.content.SharedPreferences | |
| /** | |
| * Simple extension to remove the need to call `SharedPreferences.edit()` and `SharedPreference.Editor.apply()` for | |
| * every preferences change. | |
| */ | |
| fun SharedPreferences.update(updateBlock: SharedPreferences.Editor.() -> Unit) { | |
| val editor = edit() | |
| updateBlock(editor) |
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 com.android.billingclient.api.SkuDetails | |
| import java.lang.Exception | |
| import java.text.NumberFormat | |
| import java.util.* | |
| /** | |
| * Currency code for the U.S. dollar | |
| */ | |
| private const val USD = "USD" |
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 androidx.constraintlayout.widget.ConstraintLayout | |
| import androidx.constraintlayout.widget.ConstraintSet | |
| import androidx.transition.Transition | |
| import androidx.transition.TransitionManager | |
| /** | |
| * Runs the given `updateBlock` on the current `ConstraintSet` and applies them back to the | |
| * [ConstraintLayout]. | |
| * | |
| * @param animated Whether or not to run [TransitionManager.beginDelayedTransition] on the next |
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 android.content.Context | |
| import android.graphics.drawable.Drawable | |
| import androidx.annotation.ColorInt | |
| import androidx.annotation.ColorRes | |
| import androidx.annotation.DrawableRes | |
| import androidx.annotation.StringRes | |
| import androidx.core.content.ContextCompat | |
| import java.lang.ref.WeakReference | |
| /** |
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 android.util.Log | |
| import kotlin.reflect.KClass | |
| /** | |
| * An interface meant to trivialize the mocking of Android's [Log] methods. | |
| */ | |
| interface Logger { | |
| fun v(message: String) | |
| fun d(message: String) |
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
| (function () { | |
| 'use strict'; | |
| var colorList = [ | |
| '#da1f2d', | |
| '#00a550', | |
| '#00acdc', | |
| '#f37720', | |
| '#fbaf17', | |
| '#5c5da9', |
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
| function parseURL(raw_text) { | |
| var urlRegex = /[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&~\?\/.=]+/g, | |
| parsed_text = ''; | |
| parsed_text = raw_text.replace(urlRegex, function(url) { | |
| return url.link(url); | |
| }); | |
| return parsed_text; | |
| } |
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
| function parseTweet(tweet) { | |
| var urlRegex = /[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&~\?\/.=]+/g, | |
| userRegex = /[@]+[A-Za-z0-9-_]+/g, | |
| hashRegex = /[#]+[A-Za-z0-9-_]+/g; | |
| tweet = tweet.replace(urlRegex, function(url) { | |
| return url.link(url); | |
| }); | |
| tweet = tweet.replace(userRegex, function(username) { |
NewerOlder