Skip to content

Instantly share code, notes, and snippets.

View egor-n's full-sized avatar

Egor Neliuba egor-n

  • Crunchyroll
  • Moldova
View GitHub Profile
@atimca
atimca / iOS Interview Questions
Created April 14, 2020 14:49
iOS interview questions to interviewer from candidate
Question set for interviews
Developer
Tech
- [ ] How many projects do you have
- [ ] Which architectures approaches do you use
- [ ] Which swift version / legacy objc, c what are you going to do with it.
- [ ] Do you do layout in xibs or in code?
- [ ] What do you think about reactive programming (RxSwift)
@tsjensen
tsjensen / gradle-jacoco-aggregated-report.md
Last active March 29, 2024 14:32
Gradle: Create a JaCoCo Report aggregating all subprojects

Create an Aggregated JaCoCo Report

The JaCoCo results from all subprojects shall be combined.

Requirements

  • Don't make any assumptions about where files are located in the build folders.
  • Refer to the sources of truth for getting at needed information.
  • Don't make any assumptions about which source sets are being tested. It might be main, but it might not.
  • Handle subprojects that don't JaCoCo.
@RBusarow
RBusarow / TestCoroutineExtension.kt
Last active November 20, 2023 19:03
A JUnit 4 Rule and JUnit 5 Extension for utilizing TestCoroutineDispatcher and TestCoroutineScope from kotlinx.coroutines-test
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.test.TestCoroutineDispatcher
import kotlinx.coroutines.test.TestCoroutineScope
import kotlinx.coroutines.test.resetMain
import kotlinx.coroutines.test.setMain
import org.junit.jupiter.api.extension.AfterAllCallback
import org.junit.jupiter.api.extension.AfterEachCallback
import org.junit.jupiter.api.extension.BeforeAllCallback
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.api.extension.ExtensionContext
@ErikHellman
ErikHellman / WebViewServer.kt
Last active September 12, 2023 16:10
This class is no longer needed now that Google provides WebViewAssetLoader (see https://developer.android.com/reference/kotlin/androidx/webkit/WebViewAssetLoader)
/*
MIT License
Copyright (c) 2019 Erik Hellman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@drd
drd / a-tangled-miasma.md
Last active April 15, 2019 07:57
A tangled miasma of hacks that somehow manage to launch stetho

So I got annoyed at always having to reconnect to Stetho, and I figured there would be some better way to do this in Android Studio ... and maybe there is, but this is the best I've gotten so far. Putting this together in a gist was inspired by a question on reddit: https://www.reddit.com/r/androiddev/comments/7hz3xy/stetho_anyone_know_of_a_convenient_way_to/

How does this work?

  • Use Android Studio custom Run configuration to call a new gradle task :app:launchStetho before the app launches
  • The gradle task uses launchctl (docs) to start an out-of-band AppleScript automation open-stetho.applescript
  • The AppleScript waits a few seconds, then controls Chrome to open chrome://inspect and loops until the "Inspect" action is available, and then executes a click() against that DOM element

Setup

  1. Choose a location for the applescript and ensure that it's executable `chmo
@vgaidarji
vgaidarji / update-git-user-in-sub-dirs.sh
Last active June 26, 2018 12:23
Update Git user name in sub-directories
#!/usr/bin/env sh
USER_NAME="Veaceslav Gaidarji"
USER_EMAIL="veaceslav.gaidarji@gmail.com"
echo "Using config: \n user.name=$USER_NAME, \n user.email=$USER_EMAIL\n"
for dir in */;
do
cd $dir
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 26, 2024 17:22
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@chrisbanes
chrisbanes / CollapsingTitleLayout.java
Last active March 26, 2023 11:58
CollapsingTitleLayout
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@Nilzor
Nilzor / ApkVersionPostfix.build.gradle
Last active August 29, 2015 14:08
build.gradle snippet for automatically adding version code postfix to APK file name
import javax.xml.xpath.XPathConstants
import javax.xml.xpath.XPathFactory
// Set output filename of APK based on version code from manifest when doing release build
// Note: This script will add a couple of seconds to the build script build time
gradle.projectsEvaluated {
preReleaseBuild.doFirst {
android.applicationVariants.all { variant ->
// Check version number configured in AndroidManifest
if (variant.name != "release") return
import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Log;
import java.io.*;
import java.net.CookieStore;
import java.net.HttpCookie;
import java.net.URI;
import java.net.URISyntaxException;