Skip to content

Instantly share code, notes, and snippets.

@alexisakers
alexisakers / Heroku-Vapor-Docker-Tutorial.md
Last active December 26, 2022 12:03
How to run Vapor with Docker in Heroku

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 / Array+Suffix.swift
Created November 17, 2016 11:50
Remove trailing elements in a Swift array
/*
* ==---------------------------------------------------------------------------------==
*
* File : Array+Suffix.swift
* Project : Array+Suffix
* Author : ALEXIS AUBRY RADANOVIC
*
* License : The MIT License (MIT)
*
* ==---------------------------------------------------------------------------------==
@alexisakers
alexisakers / fix.sh
Created October 26, 2020 13:49
Fix Mac video and audio/mic issues during meetings
#!/bin/zsh
FEATURE=$1
case $FEATURE in
video)
echo "Restarting camera software"
sudo killall VDCAssistant; sudo killall AppleCameraAssistant
;;
audio)
echo "Restarting audio software"
@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 {
// 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 / 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")
@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 / 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 / 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 / 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