Skip to content

Instantly share code, notes, and snippets.

View jmanalang3's full-sized avatar

Jeffrey Manalang jmanalang3

View GitHub Profile
@jmanalang3
jmanalang3 / WithPopover.swift
Created March 12, 2023 20:46 — forked from wassupdoc/WithPopover.swift
Custom size popover in iOS SwiftUI
// -- Usage
struct Content: View {
@State var open = false
@State var popoverSize = CGSize(width: 300, height: 300)
var body: some View {
WithPopover(
showPopover: $open,
popoverSize: popoverSize,
@jmanalang3
jmanalang3 / ContentView.swift
Created February 23, 2022 12:17 — forked from mecid/ContentView.swift
SwiftUI Drag and Drop example for grid items
import SwiftUI
extension RandomAccessCollection {
func indexed() -> Array<(offset: Int, element: Element)> {
return Array(enumerated())
}
}
struct ContentView: View {
@State private var items: [[String]] = [
@jmanalang3
jmanalang3 / MenuButton.swift
Created February 17, 2022 15:30 — forked from odonckers/MenuButton.swift
Solution for iOS 14 Contextual Menu Button Missing in SwiftUI
//
// MenuButton.swift
// Check Register
//
// Created by Owen Donckers on 7/16/20.
// Copyright © 2020 Owen Donckers. All rights reserved.
//
import SwiftUI
@jmanalang3
jmanalang3 / gist:53c3a4e59413058e723137a861375b95
Created June 22, 2020 10:23 — forked from spadgos/gist:8097529
Basic rebase and merge flow

Merging feature branches with rebase:

  1. git checkout master
  2. git pull --rebase to make sure you have the latest version of master
  3. git checkout feature/my-branch
  4. git rebase master ... to rebase this branch from master
    1. Optionally, git push --force to update the branch on github. This is useful for making sure it closes a pull request properly.
  5. git checkout master
  6. git merge --no-ff feature/my-branch ... merge the branch into master, making sure there's a merge commit
// https://inteist.com/git-remove-pods-folder-from-pushed-repository-how-to/
git filter-branch --index-filter 'git rm --cached --ignore-unmatch Pods/*' --tag-name-filter cat -- --all
git push --force
We can't make this file beautiful and searchable because it's too large.
pattern,cnt
^,1657
-$,376
--,355
root.*/file.*\n,348
(?m)^hello world,338
\s+,296
\s*,278
^[a-z],275
[cg]pu,245
@jmanalang3
jmanalang3 / MyTabBarController.swift
Created August 18, 2019 15:39 — forked from dsoike/MyTabBarController.swift
Swift UITabBarController with Custom Transition Animation
import UIKit
class MyTabBarController: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
delegate = self
}
}
import Foundation
import UIKit
// Usage Examples
let system12 = Font(.system, size: .standard(.h5)).instance
let robotoThin20 = Font(.installed(.RobotoThin), size: .standard(.h1)).instance
let robotoBlack14 = Font(.installed(.RobotoBlack), size: .standard(.h4)).instance
let helveticaLight13 = Font(.custom("Helvetica-Light"), size: .custom(13.0)).instance
struct Font {