Skip to content

Instantly share code, notes, and snippets.

- Supports opening documents in place LSSupportsOpeningDocumentsInPlace
- Application supports iTunes file sharing UIFileSharingEnabled
alias pip3='pip3 --trusted-host pypi.org --trusted-host files.pythonhosted.org'
alias cXed='rm -rf ~/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState && xed .'
alias clearXcode='rm -rf ~/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState'
tuist graph -t -f dot && sed -E '/(Testing)|(Example)/d' graph.dot > /tmp/tuist_graph.dot
dot -Tpdf /tmp/tuist_graph.dot -o graph.pdf && open graph.pdf
dot -Tpng /tmp/tuist_graph.dot -o graph.png
rm graph.dot
@minsOne
minsOne / query-param.codable.swift
Created July 14, 2021 04:35 — forked from RobertMenke/query-param.codable.swift
Swift Codable to URL Query String
import Foundation
import DictionaryCoding
/// Note: This relies on the DictionaryCoding package https://github.com/elegantchaos/DictionaryCoding
struct QueryParamEncoder {
func encode<T: Encodable>(_ item: T) throws -> String {
let encoder = DictionaryEncoder()
let encoded: [String: Any] = try encoder.encode(item)
let queryParams = encodeDictionary(encoded)
@minsOne
minsOne / dynamicMemberLookup Builder
Last active July 13, 2023 07:22
dynamicMemberLookup Builder
// refer: https://woowabros.github.io/swift/2021/02/18/swift-dynamic-features.html
@dynamicMemberLookup
public struct Builder<Base: AnyObject> {
private var base: Base
public init(_ base: Base) {
self.base = base
}
alias cXed='rm -rf ~/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState && xed .'
@minsOne
minsOne / KaleidoscopeView.swift
Created March 18, 2021 05:06 — forked from izakpavel/KaleidoscopeView.swift
An animation with a kaleidoscope effect
import SwiftUI
struct HalfShape: Shape {
let left: Bool
func path(in rect: CGRect) -> Path {
return Path { path in
let width = rect.width
let height = rect.height
from xml.etree.ElementTree import parse
import os
import glob
import re
import sys
moduleList = {
"App" : ["ViewController"],
"SampleCustomView" : ["GreenView", "RedView", "DummyTextField"]
}
@minsOne
minsOne / ContinuousStarRating.swift
Created December 6, 2020 23:37 — forked from CodeSlicing/ContinuousStarRating.swift
Demonstrates using relative offset on mask to control visibility of masked star rating so the color is continuous behind the stars rather than on or off for each one
//
// ContinuousStarRating.swift
//
// 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:
//
@minsOne
minsOne / RotatorView.swift
Created December 3, 2020 09:05 — forked from izakpavel/RotatorView.swift
a SwiftUI recreation of an interesting animation by @beesandbombs
//
// RotatorView.swift
//
// Created by Pavel Zak on 16/11/2020.
// original idea by: https://twitter.com/beesandbombs/status/1326312738033983489?s=20
//
import SwiftUI
func pow(_ x: Int, _ y: Int) -> Int {