Skip to content

Instantly share code, notes, and snippets.

View anoopmaddasseri's full-sized avatar
💪
Nothing great ever came that easy.!!

Anoop Maddasseri anoopmaddasseri

💪
Nothing great ever came that easy.!!
View GitHub Profile

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@anoopmaddasseri
anoopmaddasseri / Stopwatch.kt
Last active July 26, 2024 10:47
Kotlin Snippet: Benchmark elapsed execution time
package com.intigral.jawwytv.util.test
import android.os.SystemClock
/**
* Measures elapsed time in milliseconds
*/
class Stopwatch {
private var startThreadMillis: Long = 0
private var startRealtimeMillis: Long = 0
{
"txRef": "b2bbd865-648f-49ea-bbd8-65648f09eaf9",
"data": {
"planConfig": {
"stcRatePlanId": "ratePlanId",
"planName": "ENTERTAINMENT_MAX",
"freeAddOnsCount": 2,
"orderStatus": "Open"
},
"tiers": {
{
"txRef": "d967f653-a1a0-431c-a7f6-53a1a0431c34",
"data": {
"version": "1696435195",
"userClusterKey": "skyAndStbB2CGDMPRDExy0sVDlZMzND",
"environment": "prod",
"versioning": {
"enable": true,
"profile": {
"enable": true
{
"promotions": [
{
"promotionId": "h.f6ebbe78,Out Of Death Movie",
"orderId": 0,
"promoArea": [
"home:main",
"home:movies"
],
"promoType": "VOD",
@anoopmaddasseri
anoopmaddasseri / promo_banners.json
Last active August 17, 2023 07:37
promo_banners
{
"promotions": [
{
"promotionId": "h.aa80d24d,Shabab Al",
"orderId": 0,
"promoArea": [
"home:main",
"home:tvshows"
],
"promoType": "SERIES",
Capability Comments
DRM Supports Widevine, Fairplay, Playready
Streaming Protocols Supports DASH, HLS
Thumbnail Seek Requires Sprite images for Frames in WebVTT or JSON format.
Analytics Wrapper Supports integration with 3rd party Analytics & QoE Services
Multi Audio Support Tracks to be part of DASH & HLS Manifest
Quality Control Configurable limits per platform via App CMS
Live/Catchup/Startover Supports Live with seeking support along with Startover & Catchup capabilities
Offering Description
TVOD Transactional video on demand is where consumers purchase content on a pay-per-view basis.
SVOD Subscription video on demand is similar to traditional TV packages, allowing users to consume as much content as they desire at a flat rate per month.
AVOD Advertising-based video on demand Shows ads to users to generate revenue. Unlike SVOD and TVOD services, AVOD is free to consumers. However, much like broadcast television, consumers need to sit through advertisements
@anoopmaddasseri
anoopmaddasseri / KT_COLLECTION_SUM
Created October 4, 2020 06:25
Kotlin: Find sum of all values produced by the selector function applied to each element in the collection
val sumByDouble =
data.sumByDouble { serviceGroup: PackageDetails.ServiceGroup -> serviceGroup.serviceItems.price }
++++++++++++++++++++++++++++++++++++++++++
val nums = listOf(10, 20, 30)
println(nums.sum())
val totalQuantity: Int = products.map { it.quantity }.sum()
@anoopmaddasseri
anoopmaddasseri / KT_EXT_PROPERTY_LIST
Last active October 4, 2020 05:59
Kotlin: Transform collection elements to elements of either property
Option 1 -
==========
inline fun <reified T, Y> MutableList<T>.listOfField(property: KMutableProperty1<T, Y?>): MutableList<Y> {
val yy = ArrayList<Y>()
this.forEach { t: T ->
yy.add(property.get(t) as Y)
}
return yy
}