Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexis (Aubry) Akers alexisakers

View GitHub Profile
@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.
View SSReadingListItem.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 / 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
View iOS Icon.png bash script
#!/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 / MCPeerID+Reusable.swift
Last active September 21, 2016 09:00
Create stable and reusable MCPeerIDs
View MCPeerID+Reusable.swift
/*
* ==---------------------------------------------------------------------------------==
*
* File : MCPeerID+Reusable.swift
* Project : MCPeerID+Reusable
* Author : ALEXIS AUBRY RADANOVIC
* Creation Date : SEPTEMBER 21 2016
*
* 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
View ConcurrentOperation.swift
//
// ConcurrentOperation.swift
//
// Created by Caleb Davenport on 7/7/14.
//
// Learn more at http://blog.calebd.me/swift-concurrent-operations
//
import Foundation
@alexisakers
alexisakers / Array+Suffix.swift
Created November 17, 2016 11:50
Remove trailing elements in a Swift array
View Array+Suffix.swift
/*
* ==---------------------------------------------------------------------------------==
*
* File : Array+Suffix.swift
* Project : Array+Suffix
* Author : ALEXIS AUBRY RADANOVIC
*
* License : The MIT License (MIT)
*
* ==---------------------------------------------------------------------------------==
@alexisakers
alexisakers / Heroku-Vapor-Docker-Tutorial.md
Last active December 26, 2022 12:03
How to run Vapor with Docker in Heroku
View Heroku-Vapor-Docker-Tutorial.md

How to run Vapor with Docker in Heroku

In this tutorial you'll learn how to run a Vapor server in a Docker container on Heroku.

Recently, Heroku added the ability to run Docker images on their Runtime. You can use this system instead of the traditional buildpack-based system for various reasons, mainly for having more control over the environment your server will run on.

Prerequisites

To complete this tutorial, you'll need:

@alexisakers
alexisakers / CFArray+Sequence.swift
Created December 22, 2016 18:59
Extension on the CFArray type to make it conform to Sequence
View CFArray+Sequence.swift
/*
* CFArray+Sequence.swift
* Alexis Aubry Radanovic
*/
import Foundation
import CoreFoundation
extension CFArray: Sequence {
@alexisakers
alexisakers / IndexedSum.swift
Last active December 26, 2016 09:05
Indexed Summations in Swift (∑)
View IndexedSum.swift
/*
* ==---------------------------------------------------------------------------------==
*
* File : IndexedSum.swift
* Author : ALEXIS AUBRY RADANOVIC
*
* License : The MIT License (MIT)
*
* ==---------------------------------------------------------------------------------==
*
@alexisakers
alexisakers / osstatus.swift
Last active November 16, 2017 13:58
Get the description of a Security OSStatus
View osstatus.swift
#!/usr/bin/swift
import Foundation
import Security
guard CommandLine.arguments.count > 1 else {
print("USAGE: osstatus [code]")
exit(-1)
}
@alexisakers
alexisakers / update_carthage_dependencies.swift
Created September 5, 2018 14:38
Swift Script to update Carthage dependencies
View update_carthage_dependencies.swift
//
// 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.