Skip to content

Instantly share code, notes, and snippets.

View st235's full-sized avatar
🤖
Android SWE, Beep Boop Bop

Alex Dadukin st235

🤖
Android SWE, Beep Boop Bop
View GitHub Profile
import Foundation
extension NSAttributedString {
func height(containerWidth: CGFloat) -> CGFloat {
let rect = self.boundingRect(with: CGSize.init(width: containerWidth, height: CGFloat.greatestFiniteMagnitude),
options: [.usesLineFragmentOrigin, .usesFontLeading],
context: nil)
return ceil(rect.size.height)
@st235
st235 / Exercise 3. Seam Carving.ipynb
Created April 16, 2023 16:03
Royal Institution. Seam carving final task
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@st235
st235 / MainActivity.kt
Created March 12, 2023 13:19
[HSE] [My first Android application] Step 3: implement logic
package your_package_name
import android.os.Bundle
import android.os.CountDownTimer
import android.util.Log
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.AppCompatImageView
import com.github.st235.circularprogressbar.CircularProgressBar
import java.util.concurrent.TimeUnit
@st235
st235 / activity_main.xml
Last active March 12, 2023 13:19
[HSE] [My first Android application] Step 2: Timer activity
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<include
android:id="@+id/progress_content"
@st235
st235 / content_progressbar.xml
Last active March 12, 2023 13:19
[HSE] [My first Android application] Step 1: ProgressBar layout
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.github.st235.circularprogressbar.CircularProgressBar
android:id="@+id/timer_progress"
android:layout_width="match_parent"
@st235
st235 / CircularProgressBar.kt
Created February 16, 2023 00:01
CircularProgressBar
package st235.com.github.pomodoro
import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.RectF
import android.util.AttributeSet
import android.view.View
import androidx.annotation.ColorInt
@st235
st235 / Dockerfile
Created February 10, 2023 18:04
Docker file for opencv and tflite_runtime
FROM python:3.9-slim-bullseye
RUN apt-get update \
&& apt-get install ffmpeg libsm6 libxext6 -y
RUN pip3 install numpy==1.24.2 opencv-contrib-python==4.7.0.68 streamlit==1.17.0 tflite-runtime==2.11.0
RUN pip3 install black==23.1.0 pylint==2.15.10 pre-commit==3.0.2 pytest==7.2.1
@st235
st235 / SeamCarving.ipynb
Created January 2, 2023 21:38
[RI] Seam Carving
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@st235
st235 / README.md
Last active December 25, 2022 21:22
DLib Train Models
@st235
st235 / CMakeLists.txt
Created December 25, 2022 21:18
Face recognition with Dlib
cmake_minimum_required(VERSION 3.0.0)
project(face_detection VERSION 0.0.1)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
include(FetchContent)
FetchContent_Declare(dlib