Skip to content

Instantly share code, notes, and snippets.

View abbath0767's full-sized avatar

Nikita Gusarov abbath0767

View GitHub Profile
@abbath0767
abbath0767 / Main.java
Created March 6, 2019 12:10
Reversed SingleLinkedList
public class Main {
public static void main(String[] args) {
SingleLinkList<Integer> list = new SingleLinkList<>();
Random rand = new Random();
for (int i = 0; i < 10; i++) {
list.add(rand.nextInt(100));
}
System.out.println("List data: " + list.toString() + " with size: " + list.size());
@abbath0767
abbath0767 / Ivon
Last active December 5, 2018 14:33
class TestWidget extends StatefulWidget{
@override
State<StatefulWidget> createState() => TestState();
}
class TestState extends State<TestWidget> {
String _text;
@override
Widget build(BuildContext context) {
if (_text == null)
class MyScaffold extends StatelessWidget {
var restClient = RestClient();
var dropDownCurrencies = DropDownCurrency();
@override
Widget build(BuildContext context) {
// Material is a conceptual piece of paper on which the UI appears.
restClient.loadConfig().then((value) {
print("load finish. result: ${value.status}");
package ru.gorkapstroy.sensorlogger.api.mock;
import android.content.Context;
import android.util.Log;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
Метод класса B
fun reserveBadCaseDevice(workerId: Int,
condition: DeviceCondition,
result: (Unit) -> Unit,
errorText: (String) -> Unit,
errorId: (Int) -> Unit) {
val data = ReservedWorkerData(
DeviceState.TAKE,
condition, null,
class A {
val b: B
val c: String = ""
fun a(value: Int) {
b.doSomething(
value,
{
c = it + "result good"
#retrofit
# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions
# By default, the flags in this file are appended to flags specified
# in /usr/share/android-studio/data/sdk/tools/proguard/proguard-android.txt
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
##---------------Begin: proguard configuration common for all Android apps ----------
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
override fun intercept(chain: Interceptor.Chain): Response {
val request = chain.request()
val response: Response?
try {
response = chain.proceed(request)
val responseBody = response.body()
@abbath0767
abbath0767 / ExampleActivity.class
Last active May 31, 2017 14:35
Stopwatch classes for android
public class ExampleActivity extends AppCompatActivity implements SmartTimer.OnSecondTickListener {
private static final String TAG = TimerActivity.class.getSimpleName();
private TextView mTextViewTime;
private Button mButtonStart;
private Button mButtonStop;
private Button mButtonClear;
private SmartTimer mSmartTimer = new SmartTimer(this, this);