Skip to content

Instantly share code, notes, and snippets.

View fortmarek's full-sized avatar
💭
🙂

Marek Fořt fortmarek

💭
🙂
View GitHub Profile
@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active July 7, 2025 21:06
React Native Bridging Cheatsheet
@seanho
seanho / Log.swift
Created August 4, 2017 12:12
os_log() wrapper
import os.log
import Foundation
public struct Log {
static let log = OSLog(subsystem: "domain", category: "App")
static public func debug(_ message: Any) {
os_log("⚪️ DEBUG - %@", log: log, type: .debug, "\(message)")
}
@JohnSundell
JohnSundell / spm
Created August 25, 2018 18:14
A script that makes it easier to use the Swift Package Manager by making common commands less verbose 👍
#!/usr/bin/env bash
# Put this file in /usr/local/bin and then run chmod +x on it to make it executable
command=$1
shift
case $command in
"init" )
swift package init "$@"
@arturgrigor
arturgrigor / Podfile
Created September 10, 2018 09:55
Sample Podfile for silencing warnings for CocoaPods dependencies
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target '%TargetName%' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for %TargetName%
# pod 'FBSDKCoreKit'
end
@catlan
catlan / README.md
Last active May 10, 2024 15:04 — forked from zrxq/.lldbinit
Execute lldb command and open its output in Kaleidoscope diff

Diff output of two lldb commands

Setup

  1. Copy the contents of the last snippet (lldbinit) from the gist page, and paste into your .lldbinit file. This makes the ksdiff macro known inside lldb.
  2. Put file ksdiff.py in ~/.lldb/
  3. sudo pip install temp
  4. Restart Xcode debug session

Example

(lldb) ksdiff ;

@a-voronov
a-voronov / async-tasks-serial-queue.swift
Last active March 10, 2022 10:43
Async Task + Serial Queue based on ReactiveSwift ✨
import ReactiveSwift
import Result
// MARK: - Task
final class Task<V, E: Error> {
typealias ProcessingHandler = (@escaping (Result<V, E>) -> Void, DisposableBag) -> Void
enum State {
case idle
@rockbruno
rockbruno / ios_header_remover.swift
Last active September 8, 2021 09:26
iOS File Header remover script
import Foundation
func findFiles(rootPath: String, suffix: String, ignoreDirs: Bool = true) -> [String]? {
var result = [String]()
let fileManager = FileManager.default
if let paths = fileManager.subpaths(atPath: rootPath) {
let swiftPaths = paths.filter { $0.hasSuffix(suffix) }
for path in swiftPaths {
var isDir : ObjCBool = false
let fullPath = (rootPath as NSString).appendingPathComponent(path)