Skip to content

Instantly share code, notes, and snippets.

View khcrysalis's full-sized avatar
:octocat:

samara khcrysalis

:octocat:
View GitHub Profile
@drumnkyle
drumnkyle / CropImageToCircle.swift
Last active November 29, 2023 10:42
Code to mask a square image to a circle
// UIImage+Utils.swift
// This is just one way to do this.
public func croppedToCircle() -> UIImage {
// Begin a new image that will be the new image with the rounded corners
UIGraphicsBeginImageContextWithOptions(size, false, scale)
let circleWidth = size.width
let radius = circleWidth / 2
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active November 17, 2024 19:47
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@zwaldowski
zwaldowski / DoneAccessoryView.swift
Created February 11, 2019 16:01
iOS Done Accessory Bar — The two versions below are mutually exclusive
import UIKit
class DoneAccessoryView: UIInputView {
private let toolbar = UIToolbar()
init() {
super.init(frame: .zero, inputViewStyle: .default)
translatesAutoresizingMaskIntoConstraints = false
allowsSelfSizing = true
@Amzd
Amzd / PreferenceUIHostingController.swift
Last active November 14, 2024 10:01
PreferenceUIHostingController. Adds hiding home indicator and deferring system edge gestures to SwiftUI. (Don't work at the same time but I think that's normal?)
extension View {
/// Controls the application's preferred home indicator auto-hiding when this view is shown.
func prefersHomeIndicatorAutoHidden(_ value: Bool) -> some View {
preference(key: PreferenceUIHostingController.PrefersHomeIndicatorAutoHiddenPreferenceKey.self, value: value)
}
/// Controls the application's preferred screen edges deferring system gestures when this view is shown. Default is UIRectEdgeNone.
func edgesDeferringSystemGestures(_ edge: UIRectEdge) -> some View {
preference(key: PreferenceUIHostingController.PreferredScreenEdgesDeferringSystemGesturesPreferenceKey.self, value: edge)
}
@rmorey
rmorey / gen.sh
Created August 17, 2021 19:58
List of Uniform Type Identifiers
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep uti: | cut -c 29- | sort | uniq > utis.txt
@osy
osy / JBX-0001.md
Created May 19, 2022 04:49
Secure jailbreak infrastructure

Secure jailbreak infrastructure

  • Proposal: JBX-0001
  • Authors: osy
  • Status: draft

Introduction

The ecosystem of iOS [jailbreaks][1] has remained largely unchanged since iOS 1.0 even though the system internals of iOS has undergone several evolutions, enhancing security and enabling new features. iOS jailbreaks traditionally involves neutering a significant portion of the OS's security in order to enable unsigned code execution ("apps") and system modifications ("tweaks"). This allows [malware][2] to target jailbroken users and for misbehaving apps to corrupt data.

@Saik0s
Saik0s / convert.sh
Last active August 20, 2024 13:09
This shell script converts a Google Chrome extension into a Safari web extension. It prints all available extensions, prompts the user for the chrome extension path and desired name, converts and builds safari extension for macOS, and opens the built app.
#!/bin/zsh
ext_root_path=~/Library/Application\ Support/Google/Chrome/Default/Extensions
find "$ext_root_path" -name "manifest.json" -print0 | while IFS= read -r -d '' file; do echo "\033[1;33m$file\033[0m"; echo "-----------------"; cat "$file" | nl -n ln | GREP_COLOR='01;30' grep --color=always '.*'; echo "-----------------"; done
# Prompt the user for the working directory path which is chrome extension root
read -p "Enter the chrome extension path(for example difoiogjjojoaoomphldepapgpbgkhkb/2.7.7_0): " workdir
# Prompt the user for the result app name
read -p "Enter the desired app name: " app_name
@0xdevalias
0xdevalias / reverse-engineering-macos.md
Last active November 17, 2024 22:17
Some notes, tools, and techniques for reverse engineering macOS binaries
@usagimaru
usagimaru / HiddenMacOSDebuggingPanel.md
Last active October 24, 2024 23:48
Enables useful debugging panel in macOS apps

Use _NS_4445425547 or NS🐞 for enables debuggging panel. When enabled it, a ladybug 🐞 menu appears in the app menu bar.

“4445425547” means DEBUG in Unicode table.

0x44=D
0x45=E
0x42=B
0x55=U
0x47=G

[
"928350122843193385",
"1185047194261274665",
"956202276408688650",
"956104664821157918",
"1185047092478095443",
"1185046791826178099",
"1185047045413797898",
"928483283698851901",
"1185047444619284641",