Skip to content

Instantly share code, notes, and snippets.

View shanecowherd's full-sized avatar

Shane Cowherd shanecowherd

  •, Making Blocks, PBSCO, Bulb, BombBomb, Echo1612
  • Colorado Springs
  • 23:03 (UTC -06:00)
View GitHub Profile
shanecowherd / Reencoder.swift
Created February 6, 2023 21:44 — forked from trilliwon/Reencoder.swift
Reencoder ios swift
import AVFoundation
import os.log
- Use serialization queues to handle the asynchronous nature of reading and writing audiovisual data
- Initialize an asset reader and configure two asset reader outputs, one for audio and one for video
- Initialize an asset writer and configure two asset writer inputs, one for audio and one for video
shanecowherd / S3.php
Created August 7, 2022 21:20 — forked from marcoarment/S3.php
A simple PHP class to perform basic operations against Amazon S3 and compatible services.
A simple PHP class to perform basic operations against Amazon S3 and compatible
services. Requires modern PHP (7+, probably) with curl, dom, and iconv modules.
Copyright 2022 Marco Arment. Released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
shanecowherd / logMilestone.swift
Created January 31, 2020 17:05 — forked from atomicbird/logMilestone.swift
Sometimes you just want to print a message that tells you a line of code was executed. Inspired by a tweet from Paige Sun:
/// Log the current filename and function, with an optional extra message. Call this with no arguments to simply print the current file and function. Log messages will include an Emoji selected from a list in the function, based on the hash of the filename, to make it easier to see which file a message comes from.
/// - Parameter message: Optional message to include
/// - file: Don't use; Swift will fill in the file name
/// - function: Don't use, Swift will fill in the function name
/// - line: Don't use, Swift will fill in the line number
func logMilestone(_ message: String? = nil, file: String = #file, function: String = #function, line: Int = #line) -> Void {
// Feel free to change the list of Emojis, but don't make it shorter, because a longer list is better.
let logEmojis = ["😀","😎","😱","😈","👺","👽","👾","🤖","🎃","👍","👁","🧠","🎒","🧤","🐶","🐱","🐭","🐹","🦊","🐻","🐨","🐵","🦄","🦋","🌈","🔥","💥","⭐️","🍉","🥝","🌽","🍔","🍿","🎹","🎁","❤️","🧡","💛","💚","💙","💜","🔔"]
let logEmoji = logEmojis[abs(
import Foundation
import UIKit
let json = """
"first_name": "Shakti",
"last_name": "prakash",
shanecowherd / ImageCachingService.swift
Created December 20, 2017 20:12 — forked from tjbarber/ImageCachingService.swift
Simple Image Caching Service Version 00000001
// ImageCachingService.swift
// Exuberant
// Created by TJ Barber on 12/20/17.
// Copyright © 2017 Thomas J. Barber. All rights reserved.
import UIKit