Skip to content

Instantly share code, notes, and snippets.

View materkey's full-sized avatar

Vyacheslav Kovalev materkey

View GitHub Profile
@materkey
materkey / cos-src.patch
Last active December 23, 2021 04:11
cos-src patch for android emulator (for google cloud)
diff --git a/project-lakitu/sys-kernel/lakitu-kernel-5_4/files/base.config b/project-lakitu/sys-kernel/lakitu-kernel-5_4/files/base.config
index e13a9e170e..a31b2b73db 100644
--- a/project-lakitu/sys-kernel/lakitu-kernel-5_4/files/base.config
+++ b/project-lakitu/sys-kernel/lakitu-kernel-5_4/files/base.config
@@ -609,7 +609,13 @@ CONFIG_EFI_EARLYCON=y
CONFIG_HAVE_KVM=y
CONFIG_VIRTUALIZATION=y
-# CONFIG_KVM is not set
+# is not set
# Source: https://gist.github.com/48f44d3974db698d3127f52b6e7cd0d3
###########################################################
# Automation of Everything #
# How To Combine Argo Events, Workflows, CD, and Rollouts #
# https://youtu.be/XNXJtxkUKeY #
###########################################################
# Requirements:
# - k8s v1.19+ cluster with nginx Ingress
@materkey
materkey / geometry_polygons_scoring.sql
Last active September 1, 2020 00:02
use polygon to evaluate score
-- add new column to polygons table
alter table polygons
add column geom geometry;
-- fill converted coordinates to geometry field
-- noinspection SqlWithoutWhere
update polygons
set geom = ('POLYGON' ||
'((' ||
regexp_replace(
@materkey
materkey / build.gradle
Last active November 10, 2019 18:40
module level build.gradle dependencies
dependencies {
def appcompat_version = "1.1.0"
def recyclerview_version = "1.0.0"
def constraint_layout_version = "1.1.3"
def junit_version = "1.1.1"
def espresso_core_version = "3.2.0"
implementation "androidx.appcompat:appcompat:$appcompat_version"
implementation "androidx.recyclerview:recyclerview:$recyclerview_version"
implementation "androidx.constraintlayout:constraintlayout:$constraint_layout_version"
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
val fontMetrics = numberPaint.fontMetrics
val maxTextWidth = numberPaint.measureText(MAX_COUNT_STRING)
val maxTextHeight = -fontMetrics.top + fontMetrics.bottom
val desiredWidth = Math.round(maxTextWidth + paddingLeft.toFloat() + paddingRight.toFloat())
val desiredHeight = Math.round(maxTextHeight * 2f + paddingTop.toFloat() +
paddingBottom.toFloat())
-- TASK 1
CREATE TYPE clan_type AS ENUM ('red', 'blue', 'yellow');
CREATE TYPE pokemon_type_1 AS ENUM ('water', 'fire');
CREATE TYPE pokemon_type_2 AS ENUM ('poison', 'flying');
create table hunter (
hunter_id serial PRIMARY KEY ,
firstname text NOT NULL,
surname text NOT NULL,
age INTEGER NOT NULL,
-- TASK 3
-- 3.1
UPDATE dept_manager
set to_date = date('1994-06-01')
WHERE emp_no = (SELECT emp_no
FROM employees
WHERE first_name = 'Hilary'
AND last_name = 'Kambil')
AND dept_no = (SELECT dept_no
FROM departments