Skip to content

Instantly share code, notes, and snippets.

View darrarski's full-sized avatar
:octocat:
🍏🦕

Dariusz Rybicki darrarski

:octocat:
🍏🦕
View GitHub Profile
@lukeredpath
lukeredpath / LICENSE
Last active April 7, 2021 14:13
Unwrapping embedded case values in TCA test store tests
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
import SwiftUI
import PlaygroundSupport
struct showArt: View {
@Binding var isPlaying: Bool
var body: some View {
VStack {
VStack {
RoundedRectangle(cornerRadius: 16)
.shadow(color: Color(UIColor.black.withAlphaComponent( isPlaying ? 0.3 : 0.1)), radius: 20, x: 0, y: 10)
@insidegui
insidegui / Data+Compression.swift
Created July 21, 2020 15:01
A wrapper for compression/decompression of Swift Data using Apple's Compression framework.
/// Created by Gui Rambo
/// This wraps Apple's Compression framework to compress/decompress Data objects.
/// It will use Compression's modern API for iOS 13+ and its old API for older versions.
/// For more information, check out Apple's documentation: https://developer.apple.com/documentation/compression
/*
Copyright 2020 Guilherme Rambo
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@JunyuKuang
JunyuKuang / UIResponder+performWindowDrag.swift
Last active November 2, 2023 23:32
Customize/extend the window draggable area of your Mac Catalyst app.
//
// UIResponder+performWindowDrag.swift
// JonnyUtility
//
// Created by Jonny Kuang on 10/7/19.
// Copyright © 2019 Junyu Kuang <lightscreen.app@gmail.com>. All rights reserved.
//
import UIKit
// The SwiftUI Lab
// Website: https://swiftui-lab.com
// Article: https://swiftui-lab.com/alignment-guides
import SwiftUI
class Model: ObservableObject {
@Published var minimumContainer = true
@Published var extendedTouchBar = false
@Published var twoPhases = true
@steventroughtonsmith
steventroughtonsmith / UIView+Tooltips.h
Last active December 23, 2023 11:05
WIP tooltips for Mac Catalyst
//
// UIView+Tooltips.h
// Crossword
//
// Created by Steven Troughton-Smith on 13/09/2019.
// Copyright © 2019 Steven Troughton-Smith. All rights reserved.
//
#import <UIKit/UIKit.h>
@chriseidhof
chriseidhof / collectionview.swift
Last active January 31, 2024 19:00
SwiftUI Flow Layout
//
// ContentView.swift
// DeleteMe
//
// Created by Chris Eidhof on 02.02.21.
//
import SwiftUI
/*
@chriseidhof
chriseidhof / swiftui.swift
Last active March 15, 2023 06:53
SwiftUI - iOS
import Combine
import CoreFoundation
import CoreGraphics
import CoreText
import Darwin
import Foundation
import SwiftUI
import UIKit
import os.log
import os
@olegam
olegam / find_closest_scooter.js
Created February 9, 2019 15:28
Scriptable app script to find closest scooter in Copenhagen
let googleApiKey = '' // Insert your own key for Google Maps + Directions JS SDK here
let copenhagenBounds = {minLat: 55.5, minLong: 12.5, maxLat: 55.8, maxLong: 12.7}
let copenhagenCenter = {lat: copenhagenBounds.maxLat - copenhagenBounds.minLat, lng: copenhagenBounds.maxLong - copenhagenBounds.minLong}
let getLocation = Location.current()
// const getLocation = new Promise(resolve => resolve({latitude: 55.7, longitude: 12.5})) // hardcoded location resolver for airplane debug use
const [allTIERScooters, allVOIScooters, myLocation] = await Promise.all([getTIERScooters(copenhagenBounds), getVOIScooters(copenhagenBounds), getLocation])
console.log('My location: ' + JSON.stringify(myLocation))
if (allTIERScooters.length + allVOIScooters.length <= 0) {
@douglashill
douglashill / KeyboardTableView.swift
Last active March 30, 2023 22:01
A UITableView that allows navigation and selection using a hardware keyboard.
// Douglas Hill, December 2018
// Made for https://douglashill.co/reading-app/
// Find the latest version of this file at https://github.com/douglashill/KeyboardKit
import UIKit
/// A table view that allows navigation and selection using a hardware keyboard.
/// Only supports a single section.
class KeyboardTableView: UITableView {
// These properties may be set or overridden to provide discoverability titles for key commands.