THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
extension UIViewController { | |
func topMostViewController() -> UIViewController { | |
if self.presentedViewController == nil { | |
return self | |
} | |
if let navigation = self.presentedViewController as? UINavigationController { | |
return navigation.visibleViewController.topMostViewController() | |
} | |
if let tab = self.presentedViewController as? UITabBarController { | |
if let selectedTab = tab.selectedViewController { |
import UIKit | |
extension UITextView { | |
func scrollToBotom() { | |
let range = NSMakeRange(text.characters.count - 1, 1); | |
scrollRangeToVisible(range); | |
} | |
} |
extension PHPhotoLibrary { | |
typealias PhotoAsset = PHAsset | |
typealias PhotoAlbum = PHAssetCollection | |
static func saveImage(image: UIImage, albumName: String, completion: (PHAsset?)->()) { | |
if let album = self.findAlbum(albumName) { | |
saveImage(image, album: album, completion: completion) | |
return | |
} |
Last updated March 13, 2024
This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.
Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.
For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.
var db = firebase.firestore(); | |
var content = require("./sourceData.json"); | |
content && | |
Object.keys(content).forEach(contentKey => { | |
const nestedContent = content[contentKey]; | |
if (typeof nestedContent === "object") { | |
Object.keys(nestedContent).forEach(docTitle => { | |
firebase | |
.firestore() |
// | |
// UIColor+Extensions.swift | |
// Roadmap | |
// | |
// Created by Paul van Roosendaal on 19/06/2018. | |
// Copyright © 2018 Roadmap. All rights reserved. | |
// | |
// Origin: https://gist.github.com/yannickl/16f0ed38f0698d9a8ae7 |
// | |
// KeyCommand.swift | |
// Adds Keyboard Shortcuts to SwiftUI on iOS 13 | |
// See https://steipete.com/posts/fixing-keyboardshortcut-in-swiftui/ | |
// License: MIT | |
// | |
// Usage: (wrap view in `KeyboardEnabledHostingController`) | |
// Button(action: { | |
// print("Button Tapped!!") | |
// }) { |
# Convert from H264 to H265 | |
ffmpeg -i in.mov -c:v libx265 -an -x265-params crf=20 output.mp4 | |
# Tag as HVC instead of HEV1 so iOS can play it | |
ffmpeg -i output.mp4 -vcodec copy -acodec copy -tag:v hvc1 output2.mp4 | |
# Bonus: it can take a second to play (no more than H264) so here's how to generate | |
# a thumbnail of the first frame to embed in your view as a placeholder. | |
ffmpeg -i output2.mp4 -vf "select=eq(n\,34)" -vframes 1 thumbnail.png |