Skip to content

Instantly share code, notes, and snippets.

View jerryankur's full-sized avatar
🎯
Focusing

Priyanshu jerryankur

🎯
Focusing
View GitHub Profile
@jerryankur
jerryankur / export-ble-infos.py
Created June 24, 2022 23:52 — forked from Mygod/export-ble-infos.py
Export your Windows Bluetooth LE keys into Linux!
#!/usr/bin/python3
"""
Copyright 2021 Mygod
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@jerryankur
jerryankur / fake_request.py
Last active July 4, 2022 09:40 — forked from jimr/fake_request.py
Generate fake WSGIRequest objects for use in Django views
from django.core.handlers.wsgi import WSGIRequest
from io import StringIO
from django.http import QueryDict
def fake_request(method=None, fake_user=False):
'''Returns a fake `WSGIRequest` object that can be passed to viewss.
If `fake_user` is `True`, we attach a random staff member to the request.
Even if not set, you can still do this manually by setting the `user`
attribute on the returned object.
public class JsonType implements UserType<Object>, DynamicParameterizedType {
private final MutabilityPlan<Object> mutabilityPlan;
private final ObjectMapper objectMapper = new ObjectMapper();
private Type propertyType;
private Class<?> propertyClass;
public JsonType() {
this.mutabilityPlan = new MutableMutabilityPlan<>() {
@Override