Skip to content

Instantly share code, notes, and snippets.

View sergpetrov's full-sized avatar
🧑‍💻

Sergei Petrov sergpetrov

🧑‍💻
View GitHub Profile
@pavlov200912
pavlov200912 / highload.md
Last active July 1, 2025 09:29
Конспект Проектирование Высоконагруженных систем 2021

package main

/* Билеты по Проектированию Высоко нагруженных систем

  • В этом конспекте нет автоматической грамматической проверки
  • Он написан для личного пользования, исключительно для подготовки к экзамену
@3v1n0
3v1n0 / map-string-any-kotlin-serialization-tests.kt
Last active October 10, 2024 20:49
Kotlin Map<String, Any?> (andy Any type in general) (de)serialization tests with both Binary (CBOR) and JSON support
import kotlinx.serialization.*
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.CompositeDecoder
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import kotlinx.serialization.json.*
import kotlin.reflect.KType
import kotlin.reflect.full.isSubtypeOf
import kotlin.reflect.full.starProjectedType
@houssemzaier
houssemzaier / SticktModeUtil.kt
Created February 9, 2020 22:23
This solution gives the possibility to just hide the "android.os.strictmode.UntaggedSocketViolation" or just log it in a verbose lever, which I prefer.
@RequiresApi(Build.VERSION_CODES.P)
fun StrictMode.VmPolicy.Builder.detectAllExpect(ignoredViolationPackageName: String, justVerbose: Boolean = true): StrictMode.VmPolicy.Builder {
return detectAll()
.penaltyListener(Executors.newSingleThreadExecutor(), StrictMode.OnVmViolationListener
{
it.filter(ignoredViolationPackageName, justVerbose)
})
}
@by12380
by12380 / amazon-lp-from-leetcode.txt
Last active June 18, 2025 03:40
Amazon LP Questions from LeetCode Interview Experiences
1.https://interviewgenie.com/blog-1/category/Amazon+interviews
2.https://www.youtube.com/channel/UCw0uQHve23oMWgQcTTpgQsQ/playlists
3.https://medium.com/@scarletinked/are-you-the-leader-were-looking-for-interviewing-at-amazon-8301d787815d
Tell me about a situation where you had a conflict with someone on your team. What was it about? What did you do? How did they react? What was the outcome?
Give an example of when you saw a peer struggling and decided to step in and help. What was the situation and what actions did you take? What was the outcome?
Tell me about a time you committed a mistake?
Tell me about a time when your earned your teammate's trust?
@tokudu
tokudu / StrictModeManager.kt
Last active April 5, 2021 21:04
StrictMode util that allows you to whitelist stack traces
package com.myapp
import android.os.Build
import android.os.StrictMode
import com.snap.core.BuildConfig
import com.snapchat.android.framework.logging.Timber
import java.lang.reflect.Field
import java.lang.reflect.Modifier
/**
@chethann
chethann / WebviewResourceMappingHelper.java
Created November 24, 2017 09:19
WebviewResourceMappingHelper Sample Code
package com.test.android.helpers;
import android.os.Build;
import android.webkit.WebResourceResponse;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.test.android.Application;
import org.apache.commons.collections.CollectionUtils;
@polbins
polbins / Fastfile
Created October 3, 2017 03:25
Fastlane script for Uploading to Slack and Play Store Alpha
default_platform :android
platform :android do
before_all do
ENV["SLACK_URL"] = "https://hooks.slack.com/services/ABC/123/XYZ"
end
######################### PUBLIC LANES #########################
desc "Deploy a new Prod APK version to Play Store Alpha"
@brettwold
brettwold / PdfPrint.java
Last active January 19, 2025 09:59
How to save a PDF from any Android WebView
package android.print;
import android.os.CancellationSignal;
import android.os.ParcelFileDescriptor;
import android.util.Log;
import java.io.File;
public class PdfPrint {
@tzmartin
tzmartin / embedded-file-viewer.md
Last active July 23, 2025 19:24
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links