This file contains 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
/*****************************************************************************/ | |
const hawkId = pm.variables.get('hawk_id'); | |
const hawkKey = pm.variables.get('hawk_key'); | |
const hawkHeader = pm.variables.get('hawk_header') || 'authorization'; | |
/*****************************************************************************/ | |
const timestamp = parseInt(new Date().getTime() / 1000); | |
const nonce = CryptoJS.enc.Base64.stringify(CryptoJS.lib.WordArray.random(6)); |
This file contains 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
from contextlib import contextmanager | |
from ctypes import POINTER, cdll, c_char_p, c_void_p, c_int, create_string_buffer, byref | |
from sys import platform | |
# Uses a _little_ endian CTR counter, which OpenSSL doesn't directly support. | |
# Could be used to decrypt AES-encrypted ZIP files | |
def decrypt_aes_256_ctr_little_endian( | |
key, ciphertext_chunks, | |
get_libcrypto=lambda: cdll.LoadLibrary({'linux': 'libcrypto.so', 'darwin': 'libcrypto.dylib'}[platform]) | |
): |
This file contains 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
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | |
"width": 630, | |
"height": 630, | |
"data": { | |
"values": [ | |
{ | |
"type": "Feature", | |
"id": 0, | |
"geometry": { |
This file contains 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 csv | |
import logging | |
import gevent | |
from psycopg2 import ( | |
connect, | |
sql, | |
) | |
from django.conf import ( |
This file contains 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
from ctypes import ( | |
byref, | |
c_char_p, c_uint32, c_uint16, c_ubyte, | |
CDLL, | |
POINTER, | |
pointer, | |
Structure, Union, | |
sizeof, | |
) | |
import platform |
This file contains 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 asyncio | |
import contextlib | |
from fifolock import FifoLock | |
class Read(asyncio.Future): | |
@staticmethod | |
def is_compatible(holds): | |
return not holds[Write] |
This file contains 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 asyncio | |
import contextlib | |
import weakref | |
from fifolock import FifoLock | |
class Read(asyncio.Future): | |
@staticmethod | |
def is_compatible(holds): | |
return not holds[Write] |
This file contains 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 asyncio | |
import contextlib | |
import weakref | |
from fifolock import FifoLock | |
class ReadAncestor(asyncio.Future): | |
@staticmethod | |
def is_compatible(holds): | |
return not holds[Write] |
This file contains 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 asyncio | |
import contextlib | |
class PathLock(): | |
def __init__(self): | |
self.lock = asyncio.Lock() | |
@contextlib.asynccontextmanager | |
async def __call__(self, read, write): |
This file contains 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 asyncio | |
import os | |
import aiohttp | |
from aws_sig_v4_headers import aws_sig_v4_headers | |
async def main(): | |
method = 'PUT' | |
host = 's3-eu-west-1.amazonaws.com' |