Skip to content

Instantly share code, notes, and snippets.

View loganblevins's full-sized avatar

Logan Blevins loganblevins

View GitHub Profile
@farmerbb
farmerbb / optimizely-json-height.user.js
Created October 21, 2022 22:27
Userscript to increase the height of the JSON editor box for Optimizely feature variables
// ==UserScript==
// @name Optimizely - Increase Height of JSON Editor
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Increases the height of the JSON editor box for Optimizely feature variables
// @author Braden Farmer
// @match https://app.optimizely.com/*
// @grant none
// ==/UserScript==
@karambirov
karambirov / UIHostingController+SafeArea.swift
Last active September 25, 2024 12:45
How to ignore safe area in UIHostingController
import SwiftUI
extension UIHostingController {
convenience public init(rootView: Content, ignoreSafeArea: Bool) {
self.init(rootView: rootView)
if ignoreSafeArea {
disableSafeArea()
}
@sindresorhus
sindresorhus / PHImageManager-requestImage-async.swift
Created November 3, 2021 05:46
How to use `PHImageManager#requestImage` with async/await in Swift.
import Photos
struct UnexpectedNilError: Error {}
extension PHImageManager {
func requestImage(
for asset: PHAsset,
targetSize: CGSize,
contentMode: PHImageContentMode,
options: PHImageRequestOptions?
@funmia
funmia / ios-interview-resources.md
Last active April 17, 2025 11:12
General iOS, CS questions and interview prep resources.
@egzonpllana
egzonpllana / IAPService.swift
Last active May 19, 2021 12:25
StoreKit iOS Swift InAppPurchase Process SKPayment
// Created on 7/9/2020.
//
// Developed by: Kilo Loco
// Improved by Egzon Pllana
import Foundation
import StoreKit
protocol IAPServiceDelegate: class {
@cenkbilgen
cenkbilgen / URLSessionDownloadPublisher.swift
Created February 26, 2020 20:52
An extension to URLSession to create a Combine Publisher for URLDownloadTask
import Foundation
import Combine
fileprivate class CancellableStore {
static let shared = CancellableStore()
var cancellables = Set<AnyCancellable>()
}
public enum DownloadOutput {
case complete(Data)
@funmia
funmia / design-patterns.md
Created January 24, 2020 12:06
Design patterns - rayweinderlich

Design patterns - rayweinderlich

Types of design patterns

  1. Structural patterns describe how objects are composed to form larger subsystems. Examples of structural patterns are:
  1. Behavioral patterns describe how objects communicate with each other.