Skip to content

Instantly share code, notes, and snippets.

View harrydayexe's full-sized avatar

Harry Day harrydayexe

View GitHub Profile
@harrydayexe
harrydayexe / verbose.txt
Created December 4, 2024 00:12
SnapchatMemoriesCaptionAdder log output
DEBUG:root:Args(memories_history=PosixPath('input/memories_history.json'), memories_folder=PosixPath('input/memories'), output_folder=PosixPath('output'), verbose=<VerboseLevel.PROGRAM_AND_LIBRARIES: 3>, type_handled=<MediaToHandle.VIDEO: 3>, only_one=False)
INFO:__snap:211DF926-3448-4295-9272-943F90487E48 has duplicates in memories_history.json but has same data, continuing...
INFO:__snap:AEF7F4A4-2BB5-42AE-91C6-50C87013764F has duplicates in memories_history.json but has same data, continuing...
INFO:__snap:2DB39DED-7E68-498B-8C1C-1BE16BD55647 has duplicates in memories_history.json but has same data, continuing...
INFO:__snap:6C139340-4652-4DEB-8F70-5EEF541FEFD2 has duplicates in memories_history.json but has same data, continuing...
INFO:__snap:4AD5F006-3212-4354-A540-E2FD926D2266 has duplicates in memories_history.json but has same data, continuing...
INFO:__snap:60F60E5D-C5BF-4604-A45E-67059335A0DE has duplicates in memories_history.json but has same data, continuing...
INFO:__snap:4056A9AA-2474-4E75-AE
@harrydayexe
harrydayexe / snowflake.go
Created December 3, 2024 16:10
An example implementation of creating a snowflake identifier
// Package snowflake provides a very simple way to generate unique snowflake
// IDs. It is based on Twitter's snowflake algorithm. The snowflake ID is a 63
// bit integer, composed of 41 bits for time, 10 bits for node id, and 12 bits
// for a sequence number.
package snowflake
import (
"sync"
"time"
)
@harrydayexe
harrydayexe / Makefile
Created November 8, 2022 13:35
Example MakeFile for COMP26020
all: test
test: build/basic-test-suite.o build/unity.o build/matrix.o
gcc build/basic-test-suite.o build/unity.o build/matrix.o -o build/test
playground: build/playground.o build/matrix.o
gcc -g build/playground.o build/matrix.o -o build/playground
build/playground.o: playground.c matrix.h
gcc -g -c playground.c -o build/playground.o
@harrydayexe
harrydayexe / _mediaQuery.scss
Created August 4, 2022 15:01
Media Query Mixins for SASS
// Media Query Mixins
$small-width: 576px; // Phone
$medium-width: 768px; // Tablet
$large-width: 1024px; // Desktop
// Media Breakpoint Up
// sm | md | lg
@mixin media-breakpoint-up($breakpoint) {
@if $breakpoint == sm {
@media (min-width: $small-width) {
@harrydayexe
harrydayexe / shazam.fill.svg
Created April 18, 2022 23:47
SF Symbols 3.0 template for a Shazam logo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@harrydayexe
harrydayexe / RLInsiderScraper.py
Created July 8, 2021 23:30
A web scraper to pull historical item price data from rl.insider.gg
#
# Scraper.py
#
# Copyright Harry Day 2021
#
# Twitter: https://twitter.com/realharryday
# Github: https://github.com/harryday123
#
import json
@harrydayexe
harrydayexe / removeDuplicates.swift
Created June 18, 2021 12:40
A function to remove duplicate values from a dictionary
/**
This function removes duplicates from any dictionary
- Parameter dict: The input dictionary to remove duplicate values from
- Returns: The same dictionary with duplicates removed
*/
private static func removeDuplicates<Key: Hashable, Value: Hashable>(fromDict dict: Dictionary<Key, Value>) -> Dictionary<Key, Value> {
var uniqueValues = Set<Value>()
var resultDict = [Key : Value](minimumCapacity: dict.count)
for (key, value) in dict {
@harrydayexe
harrydayexe / URLProtocolStub.swift
Last active June 9, 2021 20:52
A URLProtocol Stub for use when unit testing URLSession
/// A Stub for use with unit testing URLSession
class URLProtocolStub: URLProtocol {
// this dictionary maps URLs to test data
static var testURLs = [URL?: Data]()
static var response = HTTPURLResponse(url: "https://songlinkr.harryday.xyz", statusCode: 200, httpVersion: "HTTP/1.1", headerFields: nil)
// say we want to handle all types of request
override class func canInit(with request: URLRequest) -> Bool {
return true
@harrydayexe
harrydayexe / stubbable.swift
Created May 21, 2021 10:56
Stubbable protocol for unit testing taken from SwiftBySundell
protocol Stubbable: Identifiable {
static func stub(withID id: UUID) -> Self
}
extension Stubbable {
func setting<T>(_ keyPath: WritableKeyPath<Self, T>,
to value: T) -> Self {
var stub = self
stub[keyPath: keyPath] = value
return stub
@harrydayexe
harrydayexe / DefaultFonts.css
Created April 9, 2021 10:56
CSS Default System Fonts
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}