Skip to content

Instantly share code, notes, and snippets.

Avatar
What's happening

Armin Ronacher mitsuhiko

What's happening
View GitHub Profile
View foo.md

These become tabbed automatically

Foo.bar()
[Foo bar]
View foo.txt
Some stuff here
```yaml,alert
title: Foo
body: Bar
```
Bla bla
View Cargo.toml
[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"
View terrible.diff
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,
}
View build-id-index.py
import re
import os
import io
import json
import lzma
import email
import pickle
import hashlib
import tarfile
import binascii
View whatever.rs
pub fn copy_with_progress<R: ?Sized, W: ?Sized>(
progress: &ProgressBar,
reader: &mut R,
writer: &mut W,
) -> io::Result<u64>
where
R: Read,
W: Write,
{
let mut buf = [0; 262144];
View test.html
<!doctype html>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prototype/1.6.0/prototype.min.js"></script>
<script>
(function() {
var originalStringify = JSON.stringify;
JSON.stringify = function stringify() {
var old = Array.prototype.toJSON;
delete Array.prototype.toJSON;
try {
return originalStringify.apply(this, arguments);
View foo.py
def make_failing_function(exception, function_name, filename):
code = compile('def f(): raise exception', filename, 'exec')
namespace = {'exception': exception}
eval(code, namespace)
code = namespace['f'].__code__
CodeType = type(code)
namespace['f'].__code__ = CodeType(
code.co_argcount,
code.co_nlocals,
View input.json
{
"ip": "192.168.1.1",
"message": "Hello peter@gmail.com. You signed up with card 1234-1234-1234-1234. Your home folder is C:\\Users\\peter. Look at our compliance from 127.0.0.1",
"extra": {
"foo": 42,
"bar": true
}
}
View aha.rs
{
"event_id": "cdbe646b-de0e-4f85-bdc5-2703bc517bdf"
}
->
Event {
id: Annotated {
value: Maybe::Valid(Uuid("cdbe646b-de0e-4f85-bdc5-2703bc517bdf")),
metadata: MetaData { errors: vec![] },
You can’t perform that action at this time.