Skip to content

Instantly share code, notes, and snippets.

View aplekhanov's full-sized avatar
🇨🇾
Working from home

Alex Plekhanov aplekhanov

🇨🇾
Working from home
View GitHub Profile
@msepcot
msepcot / HealthKitPRSearch.swift
Created March 3, 2021 01:07
Search HealthKit data for running PRs.
//
// ViewController.swift
// WatchAndLearn
//
// Created by Michael Sepcot on 9/18/19.
// Copyright © 2019 Michael Sepcot. All rights reserved.
//
import UIKit
import HealthKit

There's a workaround that might be useful for some people - use the Shadowsocks app for Android TV. Because that app only accepts a JSON configuration file, you need to convert the Outline key to JSON.

  1. Take the following JSON file template:
    {
        "server":"YOUR-SERVER",
        "server_port":12345,
        "local_port":1080,
        "password":"YOUR-PASSWORD",
        "method":"chacha20-ietf-poly1305",
@hishnash
hishnash / ExampleWindowReaderApp.swift
Created December 21, 2020 05:59
Access to the underlying UIWindow & NSWindow in swiftUI gives access to window methods and attributes.
//
// ExampleWindowReaderApp.swift
// Shared
//
// Created by Matthaus Woolard on 21/12/2020.
//
import SwiftUI
@main
@ThomasHack
ThomasHack / AppStoreCardAnimation.swift
Last active January 20, 2023 07:16
SwiftUI App Store Card Animation
//
// ContentView.swift
// AppStoreCard
//
import ComposableArchitecture
import FetchImage
import SwiftUI
struct ContentView: View {
@naveenkrdy
naveenkrdy / AdobeAMDFix.md
Last active March 21, 2024 15:30
To fix adobe products crashes on AMD hackintosh

Adobe Crash Fix XLNC

Instructions

  1. Install needed adobe apps from adobe creative cloud.

  2. Open Terminal.

  3. Copy-paste the below command to your terminal and run it (enter password when asked).

@MojtabaHs
MojtabaHs / SomeKindOfBool.swift
Last active June 17, 2022 15:16
Decode logical `Bool` into a real `Bool` with this simple Property Wrapper.
// MARK: - Wrapper
@propertyWrapper
struct SomeKindOfBool: Decodable {
var wrappedValue: Bool
init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
if let stringifiedValue = try? container.decode(String.self) {
switch stringifiedValue.lowercased() {
case "false", "no", "0", "n", "f": wrappedValue = false
@krummler
krummler / String+EmojiCheck.swift
Last active December 26, 2023 10:21
Emoji Checking for Swift 5.0 and up
import Foundation
extension Character {
/// A simple emoji is one scalar and presented to the user as an Emoji
var isSimpleEmoji: Bool {
return unicodeScalars.count == 1 && unicodeScalars.first?.properties.isEmojiPresentation ?? false
}
/// Checks if the scalars will be merged into and emoji
var isCombinedIntoEmoji: Bool {
// Advanced SwiftUI Transitions
// https://swiftui-lab.com
// https://swiftui-lab.com/advanced-transitions
import SwiftUI
struct CrossEffectDemo: View {
let animationDuration: Double = 2
let images = ["photo1", "photo2", "photo3", "photo4"]
@State private var idx = 0
@mgrider
mgrider / vim-swift-setup.sh
Last active March 22, 2024 01:55 — forked from jlehikoinen/setup.sh
Swift syntax highlighting for Vim
# Swift syntax highlighting for Vim
# Original Source: http://wingsquare.com/blog/swift-script-syntax-highlighting-and-indentation-for-vim-text-editor/
# Another helpful article: https://billyto.github.io/blog/swift-syntax-vim
# More about Vim packages: http://vimcasts.org/episodes/packages/
echo "--- creating ~/.vim/pack/bundle/start dir.."
mkdir -p ~/.vim/pack/bundle/start
echo "--- Cloning Apple's Swift repo.."
@jaoye
jaoye / AppStore_API.md
Last active August 9, 2023 06:23
[AppStore API] AppStore API #AppStore