Skip to content

Instantly share code, notes, and snippets.

View Bellaposa's full-sized avatar
🏝️
Working from home

bellaposa Bellaposa

🏝️
Working from home
View GitHub Profile
@sebjvidal
sebjvidal / SceneDelegate.swift
Created June 27, 2023 18:14
Custom UINavigationBar Height
// MARK: - SceneDelegate
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
let navigationController = UINavigationController(navigationBarClass: NavigationBar.self, toolbarClass: nil)
(navigationController.navigationBar as! NavigationBar).preferredHeight = 88
navigationController.setViewControllers([ViewController()], animated: false)
@CokePokes
CokePokes / gist:d50384a053478b7ac3564d121b8907d1
Last active September 10, 2020 08:38
How to use letsdowngrade
@interface letsdowngrade : NSObject
- (id)init;
- (void)performAppInstallFromBundleId:(NSString*)bundleID externalIdentifier:(NSString*)externalIdentifier promptDeletion:(BOOL)prompt;
@end
How to use in tweak:
void *handle = dlopen("/Library/MobileSubstrate/DynamicLibraries/letsdowngrade.dylib", RTLD_NOW);
if (!handle){
@berkedel
berkedel / Instance Variables and Function Pointers.md
Created July 10, 2019 01:00
Instance Variables and Function Pointers

The Unity tool. I hate it. All it does is make people worse at hacking because no one is developing actual analysis skills anymore. Now all you have to do to make an awesome hack is to CTRL-F everything until you have 100 features. If you want to get good at something, take the hard route. I can't stress that enough. Anyway, when I first heard about it, I thought it just revealed method names and locations. I was surprised upon finding that not only does it reveal method names and their locations, it reveals class names, parameters, instance variables, and the location in memory where said instance variables can be found. I couldn't believe what was right in front of me because everyone was just taking advantage of visible methods and their locations.

This applies to non-Unity games as well. You just need to have knowledge of object oriented programming to really know how to take advantage of instance variables. I guess I could cover that in a later tutorial. Anyway, let's get started.

This tutorial pertain

@SintraWorks
SintraWorks / MicroLayoutDSL.playground
Created December 28, 2017 04:54
Mini Autolayout DSL
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
typealias PairedConstraint = (_ view: UIView, _ otherView: UIView) -> NSLayoutConstraint
typealias UnpairedConstraint = (_ view: UIView) -> NSLayoutConstraint
enum ConstraintRelation {
case equal, greaterThanOrEqual, lessThanOrEqual
@nolanw
nolanw / URLRequest+MultipartFormData.swift
Last active October 5, 2023 14:31
Swift multipart/form-data
// Public domain - https://gist.github.com/nolanw/dff7cc5d5570b030d6ba385698348b7c
import Foundation
extension URLRequest {
/**
Configures the URL request for `multipart/form-data`. The request's `httpBody` is set, and a value is set for the HTTP header field `Content-Type`.
- Parameter parameters: The form data to set.
@emotality
emotality / duplicate_line_xcode.md
Last active January 24, 2025 13:49
Xcode - Duplicate Line key binding

NOTE (2022-07-09): Xcode finally added this functionality in Xcode 14, please see release notes here:

New Features in Xcode 14 Beta 3
When editing code, the Edit > Duplicate menu item and its corresponding keyboard shortcut now duplicate the selected text — or the line that currently contains the insertion point, if no text is selected. (8614499) (FB5618491)


Xcode line duplicate

Bind keys to duplicate lines in Xcode

@donnfelker
donnfelker / OrderActivity.java
Last active November 22, 2019 23:46
RxJava Bound Service AIDL Abstraction
package com.donnfelker.rxexample;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import rx.Subscriber;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;