Skip to content

Instantly share code, notes, and snippets.

View honkmaster's full-sized avatar

Tobias Totzek honkmaster

View GitHub Profile
@kieranb662
kieranb662 / StickyDrag.swift
Created November 2, 2020 03:22
Sticky drag modifier. This modifier adds a drag gesture to the view it modifies. This drag gesture behaves a lot like a rubber band be pulled to its breaking point.
// Swift toolchain version 5.0
// Running macOS version 10.15
// Created on 11/1/20.
//
// Author: Kieran Brown
//
import SwiftUI
import UIKit
@davidsteppenbeck
davidsteppenbeck / PreviewProviderModifier.swift
Last active October 31, 2022 10:30
A SwiftUI view modifier for simple preview providers.
import SwiftUI
enum PreviewProviderMode: CaseIterable {
/// Use for a light appearance preview.
case lightMode
/// Use for a dark appearance preview.
case darkMode
#!/bin/sh
# usage: waitfor.sh myserver.example.com
ping_func(){
host="$1"
$(ping -c 1 -t 1 "$host" &> /dev/null)
return $?
}
result=2
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active April 25, 2024 01:09
crack activate Office on mac with license file
@steipete
steipete / openssl-build.h
Last active May 30, 2023 11:34
Updated script that builds OpenSSL with Bitcode enabled (tested with Xcode 7.0b3)
#!/bin/bash
# This script downlaods and builds the iOS and Mac openSSL libraries with Bitcode enabled
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
# Peter Steinberger, PSPDFKit GmbH, @steipete.
set -e
@0xced
0xced / XCDFakeCarrier.m
Last active March 5, 2023 22:07
Hack to choose the displayed carrier name in the iOS simulator
//
// Copyright (c) 2012-2015 Cédric Luthi / @0xced. All rights reserved.
//
#import <Foundation/Foundation.h>
#if TARGET_OS_SIMULATOR
static const char *fakeCarrier;
static const char *fakeTime;