Skip to content

Instantly share code, notes, and snippets.

@alexisakers
alexisakers / SSReadingListItem.swift
Last active May 12, 2016 07:57
An easy and safe way to add URLs to the Safari Reading List on iOS with Swift.
//
// SSReadingListItem.swift
// Created by Alexis Aubry on 09/05/2016.
//
// The MIT License (MIT)
// Copyright (c) 2016 ALEXIS AUBRY
//
import Foundation
import SafariServices
@alexisakers
alexisakers / MCPeerID+Reusable.swift
Last active September 21, 2016 09:00
Create stable and reusable MCPeerIDs
/*
* ==---------------------------------------------------------------------------------==
*
* File : MCPeerID+Reusable.swift
* Project : MCPeerID+Reusable
* Author : ALEXIS AUBRY RADANOVIC
* Creation Date : SEPTEMBER 21 2016
*
* License : The MIT License (MIT)
*
@alexisakers
alexisakers / IndexedSum.swift
Last active December 26, 2016 09:05
Indexed Summations in Swift (∑)
/*
* ==---------------------------------------------------------------------------------==
*
* File : IndexedSum.swift
* Author : ALEXIS AUBRY RADANOVIC
*
* License : The MIT License (MIT)
*
* ==---------------------------------------------------------------------------------==
*
@alexisakers
alexisakers / ConcurrentOperation.swift
Last active July 18, 2017 03:35 — forked from calebd/AsynchronousOperation.swift
Concurrent Operation in Swift 3
//
// ConcurrentOperation.swift
//
// Created by Caleb Davenport on 7/7/14.
//
// Learn more at http://blog.calebd.me/swift-concurrent-operations
//
import Foundation
@alexisakers
alexisakers / osstatus.swift
Last active November 16, 2017 13:58
Get the description of a Security OSStatus
#!/usr/bin/swift
import Foundation
import Security
guard CommandLine.arguments.count > 1 else {
print("USAGE: osstatus [code]")
exit(-1)
}
@alexisakers
alexisakers / iOS Icon.png bash script
Last active July 5, 2018 04:33 — forked from jessedc/iOS Icon.png bash script
A simple bash script using OSX command line tool sips to resample a 1024x1024 image
#!/bin/bash
f=$(pwd)
sips --resampleWidth 512 "${f}/${1}" --out "${f}/iTunesArtwork.png"
sips --resampleWidth 1024 "${f}/${1}" --out "${f}/iTunesArtwork@2x.png"
sips --resampleWidth 20 "${f}/${1}" --out "${f}/Icon-App-20x20@1x.png"
sips --resampleWidth 40 "${f}/${1}" --out "${f}/Icon-App-20x20@2x.png"
sips --resampleWidth 60 "${f}/${1}" --out "${f}/Icon-App-20x20@3x.png"
sips --resampleWidth 29 "${f}/${1}" --out "${f}/Icon-App-29x29@1x.png"
sips --resampleWidth 58 "${f}/${1}" --out "${f}/Icon-App-29x29@2x.png"
@alexisakers
alexisakers / update_carthage_dependencies.swift
Created September 5, 2018 14:38
Swift Script to update Carthage dependencies
//
// update_carthage_dependencies
// Copyright (C) 2018 Alexis Aubry
//
// --------------------------------------------------------------------
// This script updates your Licenses plist file with the
// latest licenses and dependencies from Carthage.
//
// In Xcode, add this script as a build phase, before the "Copy Bundle
// Resources" phase in the main target.
@alexisakers
alexisakers / BLTNWebPageItem.swift
Last active December 17, 2018 16:51
Example BLTNItem for displaying a web view
import BLTNBoard
import WebKit
class BLTNWebPageItem: FeedbackPageBLTNItem {
let url: URL
init(url: URL) {
self.url = url
super.init(title: "Web Page")
// Author: Alexis Akers
// License:
// This code is published under the public domain. The software is provided "as is" without warranty
// of any kind and I cannot be held liable for any issue arising from its usage.
/// An object that performs haptic feedback.
struct Haptics {
/// Performs a success haptic feedback.
func success() {
let feedbackGenerator = UINotificationFeedbackGenerator()
@alexisakers
alexisakers / CFArray+Sequence.swift
Created December 22, 2016 18:59
Extension on the CFArray type to make it conform to Sequence
/*
* CFArray+Sequence.swift
* Alexis Aubry Radanovic
*/
import Foundation
import CoreFoundation
extension CFArray: Sequence {