Instantly share code, notes, and snippets.
🖥️
What's happening
Software developer and Open Source nut. Creator of the Flask framework. Worked on@getsentry and now exploring. Other things of interest:@pallets and @rust-lan
- Sentry
- Austria
- 05:23
(UTC +02:00) - https://lucumr.pocoo.org/
- @mitsuhiko.at
- @mitsuhiko
- @mitsuhiko@hachyderm.io
mitsuhiko /typed-metrics.ts
CreatedAugust 19, 2023 13:21
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
functioncrc32(value:string):number{ | |
return0xd0d0deadbeef; | |
} | |
typeSerializedMetric=Array<number>|number; | |
interfaceMetric<T>{ | |
add(value:T):void; | |
flush():SerializedMetric; | |
} |
mitsuhiko /reductionist-metrics.py
CreatedAugust 19, 2023 07:48
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
importtime | |
importzlib | |
fromthreadingimportLock,Thread | |
classMetric(object): | |
defadd(self,value): | |
raiseNotImplementedError() | |
defflush(self): |
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
Stuff 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
Some stuff here | |
```yaml,alert | |
title: Foo | |
body: Bar | |
``` | |
Bla bla |
mitsuhiko /Cargo.toml
CreatedNovember 17, 2019 17:28
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
[package] | |
name ="debscraper" | |
version ="0.1.0" | |
authors = ["Armin Ronacher <armin.ronacher@active-4.com>"] | |
edition ="2018" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
url ="2.1.0" |
mitsuhiko /terrible.diff
CreatedAugust 21, 2019 21:40
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
diff --git a/src/service/objects/mod.rs b/src/service/objects/mod.rs | |
index d6dcdd6..1c79c67 100644 | |
--- a/src/service/objects/mod.rs | |
+++ b/src/service/objects/mod.rs | |
@@ -313,6 +313,7 @@ pub struct ObjectsActor { | |
meta_cache: Arc<Cacher<FetchFileMetaRequest>>, | |
data_cache: Arc<Cacher<FetchFileDataRequest>>, | |
download_thread: RemoteThread, | |
+ cache_pool: ThreadPool, | |
} |
mitsuhiko /build-id-index.py
CreatedJuly 21, 2019 15:26
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
importre | |
importos | |
importio | |
importjson | |
importlzma | |
importemail | |
importpickle | |
importhashlib | |
importtarfile | |
importbinascii |
mitsuhiko /whatever.rs
CreatedDecember 25, 2018 21:52
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
pubfn copy_with_progress<R: ?Sized,W: ?Sized>( | |
progress:&ProgressBar, | |
reader:&mutR, | |
writer:&mutW, | |
) -> io::Result<u64> | |
where | |
R:Read, | |
W:Write, | |
{ | |
letmut buf =[0;262144]; |
NewerOlder