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
export class Cache<T extends object, K> { | |
items = new WeakMap<T, K>() | |
get<P extends T>(item: P, cb: (item: P) => K) { | |
if (!this.items.has(item)) { | |
this.items.set(item, cb(item)) | |
} | |
return this.items.get(item)! | |
} |
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 com.google.common.graph.Graphs | |
import com.google.common.graph.MutableValueGraph | |
import com.google.common.graph.ValueGraphBuilder | |
import org.gradle.api.DefaultTask | |
import org.gradle.api.Project | |
import org.gradle.api.artifacts.Configuration | |
import org.gradle.api.artifacts.ProjectDependency | |
import org.gradle.api.tasks.Input | |
import org.gradle.api.tasks.TaskAction | |
import org.gradle.api.tasks.options.Option |
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.os.Build.VERSION.SDK_INT | |
import android.os.Bundle | |
import android.os.Parcel | |
import android.util.Base64 | |
/** | |
* This class implements a fix for https://issuetracker.google.com/issues/147246567 | |
* Investigation: https://twitter.com/Piwai/status/1374129312153038849 | |
* | |
* Usage: |
To convert animation GIF to MP4 by ffmpeg, use the following command
ffmpeg -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4
movflags – This option optimizes the structure of the MP4 file so the browser can load it as quickly as possible.
pix_fmt – MP4 videos store pixels in different formats. We include this option to specify a specific format which has maximum compatibility across all browsers.
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
apply from: "../jacoco.gradle" | |
def debugTree = fileTree(dir: "${buildDir}/intermediates/packaged-classes/flavorUnsigned", includes: includeFileFilter, excludes: excludeFileFilter) | |
def kotlinDebugTree = fileTree(dir: "${buildDir}/tmp/kotlin-classes/flavorUnsignedDebug", includes: includeFileFilter, excludes: excludeFileFilter) | |
def mainSrc = "${project.projectDir}/src/main/java" | |
task jacocoTestReport(type: JacocoReport, dependsOn: ['testFlavorUnsignedDebugUnitTest', 'assembleDebug']) { | |
reports { | |
xml.enabled = true |
to ask for help with python and/or executing this script, join discord: https://discord.gg/zpu7YUP3Um
There's not telegram API method for this, we need to call MTProto methods to retrieve messages from the "Recent Actions" (Admin Log) since deleted messages (and medias) gets moved there for 48 hours before the permanent deletion.
from telethon import TelegramClient, events, sync
from telethon.tl.types import InputChannel, PeerChannel
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
#!/bin/bash | |
set -e | |
# CI Cache Script for Google Cloud Storage | |
# TIP: Set CI_CACHE_VERBOSE=true while testing the script | |
# to show a list of all files that are compressed/extracted. | |
# Note that you might see "tar: write error" if there are too many | |
# files in the verbose output. |
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 com.squareup.leakcanary | |
import android.app.Application | |
import com.bugsnag.android.Client | |
import com.bugsnag.android.MetaData | |
import com.bugsnag.android.Severity.ERROR | |
import com.squareup.leakcanary.BugsnagLeakUploader.ReportType.FAILURE | |
import com.squareup.leakcanary.BugsnagLeakUploader.ReportType.LEAK | |
import com.squareup.leakcanary.BugsnagLeakUploader.ReportType.NOT_FOUND | |
import com.squareup.leakcanary.BugsnagLeakUploader.ReportType.WONT_FIX_LEAK |
NewerOlder