Skip to content

Instantly share code, notes, and snippets.


Shane Cowherd shanecowherd

View GitHub Profile
shanecowherd / S3.php
Created Aug 7, 2022 — forked from marcoarment/S3.php
A simple PHP class to perform basic operations against Amazon S3 and compatible services.
View S3.php
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 Jan 31, 2020 — 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:
View logMilestone.swift
/// 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(
View codableProtocols.swift
import Foundation
import UIKit
let json = """
"first_name": "Shakti",
"last_name": "prakash",
shanecowherd / ImageCachingService.swift
Created Dec 20, 2017 — forked from tjbarber/ImageCachingService.swift
Simple Image Caching Service Version 00000001
View ImageCachingService.swift
// ImageCachingService.swift
// Exuberant
// Created by TJ Barber on 12/20/17.
// Copyright © 2017 Thomas J. Barber. All rights reserved.
import UIKit