Merging two hash maps seems like an O(N) operation. However, while merging millions of keys, I encountered a massive >10x performance degradation unexpectedly. This post explores why some of the most popular libraries fall into this trap and how to fix it. The source code is available here.
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
| # 2023-11-27 MIT LICENSE | |
| Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com. | |
| It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town. | |
| Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same! | |
| Send me your ChatGPT text adventure game on X, I'd love to try it! |
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
| // | |
| // LayoutThatFits.swift | |
| // WWDC22Experiments | |
| // | |
| // Created by Ryan Lintott on 2022-06-08. | |
| // | |
| import SwiftUI | |
| struct LayoutThatFits: Layout { |
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
| override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { | |
| super.traitCollectionDidChange(previousTraitCollection) | |
| let referenceSize = UIFont.preferredFont(forTextStyle: .body, | |
| compatibleWith: .init(preferredContentSizeCategory: .medium)) | |
| let newSize = UIFont.preferredFont(forTextStyle: .body) | |
| let percentIncrease = (newSize.pointSize / referenceSize.pointSize) * 100 | |
| let js = "document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust='\(Int(percentIncrease))%'" | |
| webView.evaluateJavaScript(js) { _, error in |
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
| <style> | |
| .git-graph { | |
| text-align: left; | |
| line-height: 1; | |
| } | |
| .git-graph-row { | |
| clear: both; | |
| text-align: left; | |
| } | |
| .git-graph-cell { |
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
| figma.showUI(__html__,{width: 250, height: 250}); | |
| // restore previous size | |
| figma.clientStorage.getAsync('size').then(size => { | |
| if(size) figma.ui.resize(size.w,size.h); | |
| }).catch(err=>{}); | |
| figma.ui.onmessage = msg => { | |
| switch (msg.type) { | |
| case "resize": | |
| figma.ui.resize(msg.size.w,msg.size.h); | |
| figma.clientStorage.setAsync('size', msg.size).catch(err=>{});// save size |
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 SwiftUI | |
| enum CustomColorScheme: Int, CaseIterable, Identifiable, Codable { | |
| static var defaultKey = "customColorScheme" | |
| static var defaultValue = CustomColorScheme.system | |
| case system = 0 | |
| case light = 1 | |
| case dark = 2 | |
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
| # Creation Date: November 3, 2018 | |
| :local Version "2.0" | |
| :local LASTUPDATE "05/10/2019" | |
| # Tested with RouterOS 6.43.4 | |
| # | |
| # Mikrotik script to implement QoS on internet connections. | |
| # The script makes use of Address Lists, Firewall rules (Mangle) for connection tagging, and Queue Trees. | |
| # The script will remove applied rules from previous runs before applying. | |
| # |
Note
to active Office without crack, just follow https://github.com/WindowsAddict/IDM-Activation-Script,
you wiil only need to run
irm https://massgrave.dev/ias | iexNewerOlder