Skip to content

Instantly share code, notes, and snippets.

View fantix's full-sized avatar
🤯

Fantix King fantix

🤯
View GitHub Profile
@fantix
fantix / gist:f00260e40b92e6a7910bc3d25330cc5c
Created January 29, 2020 15:25
Gen3 Metadata Service API
{"openapi": "3.0.2", "info": {"title": "DCFS Metadata Service", "version": "1.2.0a0"}, "paths": {"/version": {"get": {"summary": "Get Version", "operationId": "get_version_version_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/metadata_index": {"get": {"tags": ["Index"], "summary": "List Metadata Indexes", "description": "List all the metadata key paths indexed in the database.", "operationId": "list_metadata_indexes_metadata_index_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}, "security": [{"HTTPBasic": []}]}}, "/metadata_index/{path}": {"post": {"tags": ["Index"], "summary": "Create Metadata Indexes", "description": "Create a database index on the given metadata key path.", "operationId": "create_metadata_indexes_metadata_index__path__post", "parameters": [{"required": true, "schema": {"title": "Path"}, "name": "path", "in": "path"}], "responses": {"201": {"descript
@fantix
fantix / README.md
Last active January 22, 2024 15:16
Wire Protocol of PostgreSQL Queries in a Nutshell
@fantix
fantix / only-once.patch
Created October 11, 2018 02:13
#203 create transport only once
diff --git a/uvloop/sslproto.pxd b/uvloop/sslproto.pxd
index 30efa5c..e3f79a2 100644
--- a/uvloop/sslproto.pxd
+++ b/uvloop/sslproto.pxd
@@ -27,6 +27,7 @@ cdef class SSLProtocol:
object _waiter
object _loop
_SSLProtocolTransport _app_transport
+ bint _app_transport_created
@fantix
fantix / leak.py
Created October 9, 2018 12:39
uvloop#197 reproduced crash
import asyncio
import ssl
import threading
import socket
import gc
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
@fantix
fantix / test_ssl_renegotiation.py
Created June 20, 2018 03:04
Verify OpenSSL renegotiation
import ssl
from OpenSSL import SSL
ctx = SSL.Context(SSL.TLSv1_2_METHOD)
ctx.set_options(SSL.VERIFY_NONE)
ctx.use_privatekey_file('tests/certs/ssl_key.pem')
ctx.use_certificate_chain_file('tests/certs/ssl_cert.pem')
server = SSL.Connection(ctx, None)
server.set_accept_state()
use std::comm::{Select, Receiver};
use std::collections::HashMap;
trait Endpoint {
fn register(&self, selector: &Select) -> uint;
fn on_event(&self);
}
@fantix
fantix / gist:9246648
Created February 27, 2014 08:54
long -> integer_types
def __init__(self, fileno, mode=None, close=True):
- if not isinstance(fileno, (int, long)):
+ if not isinstance(fileno, integer_types):
raise TypeError('fileno must be int: %r' % fileno)