Skip to content

Instantly share code, notes, and snippets.

@mik9
mik9 / docker-compose.yaml
Last active November 20, 2018 15:17
Simple vpn config.
version: "2"
services:
vpn:
image: siomiz/softethervpn
ports:
- "1194:1194/udp"
- "1701:1701"
- "1701:1701/udp"
- "4500:4500/udp"
- "500:500/udp"
@mik9
mik9 / DateHelper.kt
Last active October 22, 2018 15:54
Full period between date and now
private val diffChronoUnits = arrayListOf(
ChronoUnit.YEARS,
ChronoUnit.MONTHS,
ChronoUnit.WEEKS,
ChronoUnit.DAYS,
ChronoUnit.HOURS,
ChronoUnit.MINUTES,
ChronoUnit.SECONDS
)
@mik9
mik9 / build.gradle
Last active October 6, 2019 05:53
Findbugs/Spotbugs task configuration for Android project
def isCi = System.getenv().JOB_NAME != null
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "gradle.plugin.com.github.spotbugs:gradlePlugin:1.6.0"
}
}
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html.
Configuration on demand is an incubating feature.
Jack is disabled, but one of the plugins you are using supports Java 8 language features.
Jack is disabled, but one of the plugins you are using supports Java 8 language features.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2421Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72421Library UP-TO-DATE
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html.
Configuration on demand is an incubating feature.
Jack is disabled, but one of the plugins you are using supports Java 8 language features.
Jack is disabled, but one of the plugins you are using supports Java 8 language features.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2421Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72421Library UP-TO-DATE
/*
* Copyright (C) 2011 The Android Open Source Project
*
* 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
@mik9
mik9 / rtc-alarm.c
Created October 1, 2012 19:49
Morning Alarms
#include <stdio.h>
#include <linux/rtc.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <time.h>
#include <sys/types.h>
@mik9
mik9 / uk.patch
Created September 22, 2012 22:56
LatinIME: Add missing ukrainian letters.
commit 9856432a8d68aa0ae0610c255cd845cdac280d0c
Author: Kyrylo Mikos <kiril.mik.os@gmail.com>
Date: Wed Sep 26 16:43:51 2012 +0300
LatinIME: Add missing ukrainian letters.
Change-Id: Ib6f18d3aeee33b8e5f1843781cebd81eec2928a7
diff --git a/java/res/xml/rowkeys_east_slavic1.xml b/java/res/xml/rowkeys_east_slavic1.xml
index 00cb6a9..7dcee3f 100644
@mik9
mik9 / edit_text_selection_patch.patch
Created August 21, 2012 15:04
EditText selection patch
diff --git a/base/core/java/android/text/Layout.java b/base2/core/java/android/text/Layout.java
old mode 100644
new mode 100755
index 9695533..b5f32d4
--- a/base/core/java/android/text/Layout.java
+++ b/base2/core/java/android/text/Layout.java
@@ -61,6 +61,7 @@ public abstract class Layout {
};
private RectF mEmojiRect;
@mik9
mik9 / gist:2820263
Created May 28, 2012 17:45
convert work to delayed_work
diff --git a/drivers/input/touchscreen/ft5x06-i2c.c b/drivers/input/touchscreen/ft5x06-i2c.c
index cd27c11..3341e1d 100644
--- a/drivers/input/touchscreen/ft5x06-i2c.c
+++ b/drivers/input/touchscreen/ft5x06-i2c.c
@@ -70,7 +70,7 @@
struct ft5x06 {
struct i2c_client *client;
struct input_dev *input;
- struct work_struct work;
+ struct delayed_work work;