Skip to content

Instantly share code, notes, and snippets.

View camdenfullmer's full-sized avatar

Camden Fullmer camdenfullmer

View GitHub Profile
@camdenfullmer
camdenfullmer / Dockerfile
Last active April 7, 2021 18:09
GitHub workflow to deploy an AWS Lambda function using the Swift AWS Lambda Runtime (https://github.com/swift-server/swift-aws-lambda-runtime). Found this necessary since there are issues building/running x86 Docker containers on a M1 MacBook.
FROM swift:5.3-amazonlinux2
RUN yum -y install zip openssl-devel
@camdenfullmer
camdenfullmer / Dockerfile
Last active January 20, 2020 14:52
Run NVIDIA Video Codec SDK samples
FROM nvidia/cuda:10.2-devel-ubuntu18.04
RUN apt-get update && apt-get install -qy freeglut3-dev libegl1-mesa-dev libglew-dev pkg-config unzip wget yasm
# Get the Video Codec SDK Samples (an updated set of samples can be found using NVIDIA's site at https://developer.nvidia.com/nvidia-video-codec-sdk/download)
RUN cd /tmp && \
wget https://github.com/NVIDIA/video-sdk-samples/archive/master.zip && \
unzip master.zip && \
rm master.zip && \
mv video-sdk-samples-master /usr/src/app
@camdenfullmer
camdenfullmer / create-ghost-publication.sh
Last active March 3, 2019 22:59
A script that creates a Ghost publication on DigitalOcean.
#!/bin/bash
set -e
set -o pipefail
DROPLET_NAME=my-ghost-publication
DOMAIN=""
SUBDOMAIN=""
IMAGES_DIR=""
THEMES_DIR=""
KEYS_DIR="~/.create-ghost-publication/keys"
@camdenfullmer
camdenfullmer / collect_memory_usage.sh
Created October 18, 2018 15:23
Collect memory usage from a Docker container into a CSV file
#!/bin/bash
while true; do
docker stats --no-stream --format "{{.MemPerc}}," $1 >> memory_usage.csv;
done
@camdenfullmer
camdenfullmer / CMFWallpaper.m
Last active February 18, 2024 03:05
Set the wallpaper (lock and/or home screen) on iOS using Apple's private API. Please be aware that including this code in an App Store submission will result in a rejection. This has only been tested on iOS 9.2.
@implementation CMFWallpaper
+ (void)setImage:(UIImage *)image {
NSAssert([PHPhotoLibrary authorizationStatus] == PHAuthorizationStatusAuthorized, @"access to photos is needed to set the wallpaper");
NSString *path;
#if TARGET_OS_SIMULATOR
path = @"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibrary.framework";
#else
path = @"/System/Library/PrivateFrameworks/PhotoLibrary.framework";