Skip to content

Instantly share code, notes, and snippets.

:octocat:

Artem Chepurnoy AChep

:octocat:
Block or report user

Report or block AChep

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AChep
AChep / kodein_viewModel.kt
Created Dec 6, 2019
Helper methods to retrieve an instance of ViewModel via Kodein.
View kodein_viewModel.kt
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModelStoreOwner
import org.kodein.di.*
import org.kodein.di.generic.bind
import org.kodein.di.generic.factory
import org.kodein.di.generic.instance
import org.kodein.di.generic.provider
class ViewModelFactory(private val injector: LazyKodein) : ViewModelProvider.Factory {
@AChep
AChep / string_calculator_kata.py
Created Feb 12, 2019
This is a String Calculator
View string_calculator_kata.py
import re
def add(text):
"""
String Calculator
http://osherove.com/tdd-kata-1/
"""
if not text:
return 0
@AChep
AChep / ConfigBase.kt
Last active Jun 7, 2018
Base class for a simple config
View ConfigBase.kt
import android.content.Context
import android.content.SharedPreferences
import android.os.Looper
import kotlin.properties.ObservableProperty
import kotlin.reflect.KProperty
/**
* @author Artem Chepurnoy
*/
abstract class ConfigBase {
View MainActivity.kt
package com.artemchep.webviewscroll
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.webkit.JavascriptInterface
import android.webkit.WebView
import android.webkit.WebViewClient
import kotlinx.android.synthetic.main.activity_main.*
View horario_pp.txt
Your privacy is important to us.
We have developed this privacy policy in order for you to understand how we collect, use, communicate, disclose and otherwise make use of personal information.
We have outlined our privacy policy below.
We will never sell your information or share it with third parties for marketing purposes.
We will make readily available to customers information about our policies and practices relating to the management of personal information.
@AChep
AChep / fa1fly_test.kt
Last active Jan 5, 2018
Copy paste code to Filename.kt and compile (Kotlin required). Supported keys: TAB to select or switch between figures, ARROWS to move them.
View fa1fly_test.kt
import java.awt.Color
import java.awt.Graphics
import java.awt.Graphics2D
import java.awt.RenderingHints
import java.awt.event.*
import javax.swing.SwingUtilities
import javax.swing.JFrame
import javax.swing.JPanel
fun main(args: Array<String>) {
View acdisplay_pp.txt
Your privacy is important to us.
We have developed this privacy policy in order for you to understand how we collect,
use, communicate, disclose and otherwise make use of personal information.
We have outlined our privacy policy below.
• AcDisplay does not collect or store personal information. Access to information is required
in order to display it.
View gist:ce250476d0aec34818d2
program matrix_solver;
const
MAX_LEN = 10;
type
MATRIX = record
m : array [1..MAX_LEN, 1..MAX_LEN] of real;
n : integer;
end;
You can’t perform that action at this time.