Skip to content

Instantly share code, notes, and snippets.

View mfessenden's full-sized avatar

Michael Fessenden mfessenden

  • Nike
  • Portsmouth, NH
View GitHub Profile
@juliusgeo
juliusgeo / README.md
Created July 10, 2023 23:45
Bits and Pieces: zlib compliant DEFLATE from scratch

Bits and Pieces: zlib compliant DEFLATE from scratch

zlib underlies most zip file decompressors, and DEFLATE is one the binary formats used to store compressed data in a bitstream. The goal of this article is to walk through how my Python DEFLATE compressor implementation works. There are many guides on the internet that describe how to implement each step of DEFLATE, but very few end up producing a bitstream that can actually be parsed by a library like zlib. This article assumes that you roughly know how each step of the DEFLATE algorithm is implemented, but are having trouble with some of the finer points that are often glossed over.

The code can be found in "deflate.py".

@kconner
kconner / macOS Internals.md
Last active May 6, 2024 22:20
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@raysan5
raysan5 / custom_game_engines_small_study.md
Last active May 7, 2024 19:39
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

//:
//: UserDefaultable.swift
//:
//: Created by Andyy Hope on 18/08/2016.
//: Twitter: @andyyhope
//: Medium: Andyy Hope, https://medium.com/@AndyyHope
import Foundation
// MARK: - Key Namespaceable
@stinger
stinger / Swift3Dates.swift
Last active May 21, 2018 02:04
Swift 3: Working with dates
//: # Swift 3: Working with dates
import Foundation
let date = Date()
let myLocale = Locale(identifier: "bg_BG")
//: ### Setting an application-wide `TimeZone`
//: Notice how we use if-let in case the abbreviation is wrong. It will fallback to the default timezone in that case.
if let myTimezone = TimeZone(abbreviation: "EEST") {
print("\(myTimezone.identifier)")
import Foundation
//
// XcodeKitDefines.h
// Xcode
//
// Copyright © 2016 Apple Inc. All rights reserved.
//
/** The build version of XcodeKit itself.
import Foundation
import Compression
/// A convenience class for compressing an NSData object.
///
/// Example:
/// ```
/// let compression = Compression(algorithm: .ZLIB)
/// let compressedData = compression.compressData(data)
/// let decompressedData = compresison.decompressData(compressedData)
@cruinh
cruinh / GlowFilter.swift
Last active July 21, 2022 01:08
GlowFilter for CoreImage in Swift
//
// GlowFilter.swift
// based on ENHGlowFilter from http://stackoverflow.com/a/21586439/114409
//
// Created by Matthew Hayes on 12/27/15.
//
import Foundation
import UIKit
import CoreImage
@tanner0101
tanner0101 / NSDataExtensions.swift
Last active February 3, 2017 04:18
Convert to and from NSData for common Swift types. Includes Eddystone URL conversion.
//
// NSData.swift
// Pods
//
// Created by Tanner Nelson on 9/15/15.
//
//
import Foundation
@MihaiTabara
MihaiTabara / tweepy_runner.py
Last active September 8, 2021 16:03
Script to download Twitter timeline for a user and store it to MongoDB
# script to download up to <= 3200 (the official API limit) of most recent tweets from a user's timeline
from pymongo import MongoClient
import tweepy
import json
#Twitter API credentials
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''