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){
@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 April 6, 2024 04:23
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;