This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
// use cases that only need to return a value | |
public struct ValueProvider<Output>: Sendable { | |
private var provider: @Sendable () -> Output | |
public init(provider: @escaping @Sendable () -> Output) { | |
self.provider = provider | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// DynamicTypeStack.swift | |
// | |
// Created by Karl Sims on 15/03/2024. | |
// | |
import SwiftUI | |
struct DynamicTypeStack<Content: View>: View { | |
@Environment(\.dynamicTypeSize) var dynamicTypeSize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
tfidf.js provides a class which provides methods and data structures for the | |
creating a tf-idf vector representation of a collection of documents. | |
It also provides added methods for comparing documents through cosine | |
similarity. | |
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' | |
## Tf-Idf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
delete_tweets.py | |
Helps deletes all your tweets 1000 at a time. | |
NOTE: WARNING THIS WILL DELETE APPROXIMATELY 750 TWEETS OF THE AUTHORISED | |
ACCOUNT THAT IS ACCESSING THE API. THIS CANNOT BE UNDONE. | |
NOTE: Requires app authentication from https://apps.twitter.com/ with read - | |
write privileges. You set your authentication tokens as enviroment varibles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Conway's Game of Life. | |
Fundamental Rules: | |
1) Any live cell with fewer than two live neighbors dies, | |
as if caused by underpopulation. | |
2) Any live cell with more than three live neighbors dies, | |
as if by overcrowding. |