Skip to content

Instantly share code, notes, and snippets.

View jordibruin's full-sized avatar

Jordi Bruin jordibruin

View GitHub Profile
@insidegui
insidegui / reloadplugins.sh
Created January 29, 2022 23:00
Make your Mac app's extensions immediately available on macOS with a run script build phase
# Add this to a "Run Script" build phase in your app's main target, as the last step.
# It will use the pluginkit command-line tool to force the plugin system on macOS to add your extensions to its database, making them available.
# I made this specifically for widgets, but it should work for pretty much any extension type (appex bundle).
find $CODESIGNING_FOLDER_PATH -name '*.appex' -exec pluginkit -a {} \;
@mralexhay
mralexhay / SwiftUI Tagger.swift
Last active March 11, 2024 06:35
A SwiftUI interface for adding tags
//
// TaggerView.swift
//
// Created by Alex Hay on 21/11/2020.
//
// Simple interface for adding tags to an array in SwiftUI
// Example video: https://imgur.com/gallery/CcA1IXp
// alignmentGuide code from Asperi @ https://stackoverflow.com/a/58876712/11685049
import SwiftUI
import UIKit
class RootViewController: UIViewController {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
let text = "Cute cat"
let image = UIImage(named: "cat.jpg")!
// Note: you can't wrap the text and image into a single "TextImage" object and selectively return both or one as UIActivityItemSource doesn't like holding arrays
@douglashill
douglashill / explore-localisation-glossaries.swift
Last active August 24, 2022 05:39
Prints out translations from Apple’s glossary files matching text in a supplied English .strings file. Read more: https://douglashill.co/localisation-using-apples-glossaries/
#! /usr/bin/swift
// Douglas Hill, March 2020
// Prints out translations from Apple’s glossary files matching text in a supplied English .strings file.
// More detail in the article at https://douglashill.co/localisation-using-apples-glossaries/
import Foundation
let stringsSource = URL(fileURLWithPath: "PUT THE PATH TO YOUR ENGLISH .strings FILE HERE")
/**
This sample code is available under the MIT license.
*/
@available(iOS 12.0, *)
public final class ShortcutManager {
/**
This enum specifies the different intents available in our app and their various properties for the `INIntent`.
Replace this with your own shortcuts.
# setup
# pip install cryptography pyjwt
# ref.
# http://gobiko.com/blog/token-based-authentication-http2-example-apns/
import jwt
import time
ALGORITHM = 'ES256'
@mattes
mattes / make-a-call.alfredworkflow
Last active June 16, 2021 18:20
Place a call from Alfred using your iPhone (Mac OS X Yosemite & iOS 8)
@paul-delange
paul-delange / GIFDownloader.h
Created November 18, 2012 09:10
Convert remote GIF into something MPMoviePlayerController can use
//
// GIFDownloader.h
// TheJoysOfCode
//
// Created by Bob on 29/10/12.
// Copyright (c) 2012 Tall Developments. All rights reserved.
//
#import <Foundation/Foundation.h>