Skip to content

Instantly share code, notes, and snippets.

View flaksp's full-sized avatar
🍏

Petr Flaks flaksp

🍏
View GitHub Profile
@flaksp
flaksp / README.md
Last active April 23, 2024 12:16
Userscript для автоматического редиректа с m.vk.com на vk.com

Userscript для автоматического редиректа с m.vk.com на vk.com

Юзерскрипт совместим с Userscripts, Tampermonkey, и может быть совместим с другими аналогичными приложениями, которые поддерживают такой формат юзерскриптов.

Как установить

Откройте "Redirect from m.vk.com to vk.com.user.js" в браузере. Ваше расширение для юзерскриптов поймет, что это юзерскрипт, и предложит его установить. Либо скопируйте содержимое файла и создайте юзерскрипт самостоятельно.

Юзерскрипт будет обновляться автоматически, если я решу его доработать. Если вам не нужно автообновление, то удалите строки @updateURL и @version.

@flaksp
flaksp / README.md
Last active March 10, 2024 12:43
Compilable Needle dependency injection framework example

Compilable Needle RootComponent example

Documentation of the Needle dependency injection framework sucks, and most of articles teaching you how to use it are outdated. That's the reason why it's really hard to write even a minimal-working version of the code that compiles.

This is a simple example of RootComponent that compiles successfully. Based on a code from an article "Dependency Injection with Needle", but modified to make it work.

Bonus: How to configure Xcode

  1. Go to your target
  2. Build Phases
@flaksp
flaksp / HeroImageSlider.swift
Last active March 10, 2024 12:49
Hero Image Slider in SwiftUI with parallax effect
import SwiftUI
struct HeroImageSlider: View {
public let coverHeight: CGFloat
public let imageUrls: [URL]
@State private var pageIndex = 0
private let screenWidth: CGFloat = UIScreen.main.bounds.width
private let cornerRadius: CGFloat = 12
@flaksp
flaksp / README.md
Last active May 1, 2024 23:06
Convert BitWarden JSON export file to Apple iCloud Keychain CSV import file saving TOTP and notes

BitWarden to Apple iCloud Keychain passwords converter

This Python scripts allows you to move your passwords from BitWarden to Apple iCloud.

You need to know:

  • It ignores secure notes, credit cards and other types that are not passwords.
  • It ignores BitWarden entries without usernames, passwords and URLs.
  • It also ignores URLs that do not start with http:// or https://.
  • It normalizes all TOTP tokens, e.g. wskg vtqa h5kl bhb4 v4v2 ybyo woc6 qme2 will be converted to otpauth://totp/example.com:dude@foo.bar?secret=WSKGVTQAH5KLBHB4V4V2YBYOWOC6QME2&issuer=example.com&algorithm=SHA1&digits=6&period=30.