Skip to content

Instantly share code, notes, and snippets.

View ffittschen's full-sized avatar

Florian Fittschen ffittschen

View GitHub Profile
@ryanlintott
ryanlintott / LayoutThatFits.swift
Last active December 8, 2023 15:14
An alternative to ViewThatFits. Updated version can be found here: https://github.com/ryanlintott/LayoutThatFits
//
// LayoutThatFits.swift
// WWDC22Experiments
//
// Created by Ryan Lintott on 2022-06-08.
//
import SwiftUI
struct LayoutThatFits: Layout {
@marco79cgn
marco79cgn / dm-toilet-paper.js
Last active February 29, 2024 17:35
iOS Widget, das die Anzahl an Klopapier Packungen in deiner nächsten dm Drogerie anzeigt (für die scriptable.app)
// dm Klopapier Widget
//
// Copyright (C) 2020 by marco79 <marco79cgn@gmail.com>
//
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
// IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
@rphl
rphl / incidence.js
Last active December 18, 2023 12:33 — forked from kevinkub/incidence.js
COVID-19 Inzidenz-Widget für iOS innerhalb Deutschlands 🇩🇪 (Kreis/Stadt + Bundesland + Trend)
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: red; icon-glyph: briefcase-medical;
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
// Alte version siehe: https://gist.github.com/rphl/0491c5f9cb345bf831248732374c4ef5/revisions
WIDGET WURDE IN EIN REPO VERSCHOBEN, SIEHE:
https://github.com/rphl/corona-widget

A fix for debugging shared precompiled binaries from Carthage.

error: Couldn't IRGen expression, no additional error

Usage

./build.sh --platform ios MyCoolFramework

@warpling
warpling / CAMediaTimingFunction.swift
Last active June 14, 2022 11:15
Better CAMediaTimingFunctions
//
// CAMediaTimingFunction.swift
import UIKit
extension CAMediaTimingFunction {
static let linear = CAMediaTimingFunction(name: .linear)
static let easeOut = CAMediaTimingFunction(name: .easeOut)
@trung
trung / notify.yml
Last active October 6, 2022 08:47
Notify slack about Github Actions workflow and its jobs status. `notify` job must be the last job in the workflow and it must depend on all other jobs
notify:
if: always()
name: Notify
needs:
- job1
- job2
- job11
- job3
- job4
runs-on: ubuntu-latest
@dtbaker
dtbaker / exportImagesFromFigma.js
Created November 28, 2019 01:09
Extract Images from Figma to S3
// This takes an array of images (from getFigmaImageIds) and exports them to S3.
const exportImagesFromFigma = async ({figmaImages, figmaExportScale = 1}) => {
const figmaFileId = await getSecretConfiguration('figma_file_id')
const figmaApiKey = await getSecretConfiguration('figma_api_key')
const exportedImages = []
const imageIdsToExport = figmaImages.map(image => image.imageId)
@sindresorhus
sindresorhus / NativeButton.swift
Created October 11, 2019 08:58
Example of using NSButton in SwiftUI to access missing features like `keyEquivalent` (for example, to make the button the default and highlighted). Stack Overflow answer: https://stackoverflow.com/a/58337529/64949
/**
```
struct ContentView: View {
var body: some View {
NativeButton("Submit", keyEquivalent: .return) {
// Some action
}
.padding()
}
}
@fpg1503
fpg1503 / ColorContext+UITraitCollection.swift
Created June 7, 2019 22:12
Dynamic Color Palettes that resolve immediately on older versions
extension ColorContext {
@available(iOS 13.0, *)
init(_ traitCollection: UITraitCollection,
defaultMode: Mode = .light,
defaultElevation: Elevation = .base,
defaultAccessibilityContrast: AccessibilityContrast = .normal) {
mode = {
switch traitCollection.userInterfaceStyle {
case .light: return .light
case .dark: return .dark
@neoneye
neoneye / Logging.swift
Created March 29, 2019 16:16
SwiftyBeaver using Apple's unified logging system (OSLog)
// Copyright © 2019 Simon Strandgaard. All rights reserved.
import SwiftyBeaver
public let log = SwiftyBeaver.self
extension BaseDestination.LevelColor {
mutating func applyDefaultStyle() {
debug = "🏐 "
info = "🏐 "
verbose = "🏐 "