Skip to content

Instantly share code, notes, and snippets.

@AppleBetas
AppleBetas / Device.swift
Last active April 13, 2019 19:06
Device.swift - Cross-platform class for device model and model identifier information
//
// Device.swift
//
// Created by AppleBetas on 2015-12-30.
// Copyright © 2015 AppleBetas. All rights reserved.
//
import Foundation
class Device {
@AppleBetas
AppleBetas / Remove transparency.sh
Last active October 24, 2016 04:12
Remove transparency.sh - A quick command to remove transparency from images in a directory with ImageMagick
# Remove alpha channel and replace with black
mogrify -background black -alpha remove -alpha off *.png
# Check alpha channel of images in directory (requires Xcode and command-line tools; not required)
sips -g hasAlpha *.png

Keybase proof

I hereby claim:

  • I am AppleBetas on github.
  • I am applebetas (https://keybase.io/applebetas) on keybase.
  • I have a public key whose fingerprint is 84DC 84E8 169F 6DB6 E7B3 03D5 CD41 B403 E6E0 7E2E

To claim this, I am signing this object:

@AppleBetas
AppleBetas / UIAlertAction+Image.swift
Created September 11, 2016 17:17
UIAlertAction+Image.swift - An easier way to add images to UIAlertActions (alerts and action sheets)
//
// UIAlertAction+Image.swift
//
// Created by AppleBetas on 2016-09-11.
// Copyright © 2016 AppleBetas. All rights reserved.
//
import UIKit
extension UIAlertAction {
@AppleBetas
AppleBetas / UIViewController+QuickAlert.swift
Last active January 15, 2017 06:43
UIViewController+QuickAlert.swift - A UIViewController extension to quickly show alerts
//
// UIViewController+QuickAlert.swift
//
// Created by AppleBetas on 2016-09-11.
// Copyright © 2016 AppleBetas. All rights reserved.
//
import UIKit
extension UIViewController {
@AppleBetas
AppleBetas / Colour.swift
Last active July 10, 2016 03:33
Colour.swift - A great way to add quick colours to command-line Swift apps with a quick and easy API
//
// Colour.swift
//
// Created by AppleBetas on 2016-07-09.
// Copyright © 2016 AppleBetas. All rights reserved.
//
/*
Example usage: