Skip to content

Instantly share code, notes, and snippets.

View hylarucoder's full-sized avatar
🐍
🐍🐍🐍

HylaruCoder hylarucoder

🐍
🐍🐍🐍
View GitHub Profile
@alexanderbazo
alexanderbazo / build.yml
Created December 6, 2019 16:07
Github Actions: Build and Release Android-APK
name: Minimal Android CI Workflow
on:
push:
branches:
- master
tags:
- 'v*'
jobs:
@czfshine
czfshine / unmiui.sh
Last active December 19, 2019 09:03
将小米手机备份的应用数据解包
#重点是跳过前面41个字节,MIUI加的文件头要去掉
dd if=微信\(com.tencent.mm\).bak of=backup.db bs=512M skip=41 iflag=skip_bytes
java -jar abe-all.jar unpack backup.db backup.tar
@uobikiemukot
uobikiemukot / emoji.go
Created December 11, 2018 07:58
emoji and text renderer
package main
import (
"bufio"
"bytes"
"fmt"
"image"
"image/jpeg"
_ "image/png"
"io"
@denis-ryzhkov
denis-ryzhkov / patch_graphene_django_JSONField_converter.py
Last active December 25, 2024 06:11
Ask `graphene_django` to convert `JSONField` to `GenericScalar` (JSON as is) instead of default `JSONString`
from django.contrib.postgres.fields import JSONField
from graphene.types.generic import GenericScalar
from graphene.utils.str_converters import to_camel_case, to_snake_case
from graphene_django.converter import convert_django_field
def patch_graphene_django_JSONField_converter(auto_camel_case=True):
"""
Ask `graphene_django` to convert `JSONField` to `GenericScalar` (JSON as is) instead of default `JSONString`
@mbrochh
mbrochh / 01_utils.py
Last active September 24, 2023 10:45
Using pagination with Django, graphene and Apollo
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
# First we create a little helper function, becase we will potentially have many PaginatedTypes
# and we will potentially want to turn many querysets into paginated results:
def get_paginator(qs, page_size, page, paginated_type, **kwargs):
p = Paginator(qs, page_size)
try:
page_obj = p.page(page)
except PageNotAnInteger:
@sirosen
sirosen / sign.py
Last active January 25, 2024 20:46
Sign and Verify Using RSA via cryptography (python)
"""
RSA Sign a Message using a private key
Just turns this example into a script:
https://cryptography.io/en/latest/hazmat/primitives/asymmetric/rsa/#signing
"""
import sys
import hashlib
import base64

Install dlib and face_recognition on a Raspberry Pi

Instructions tested with a Raspberry Pi 2 with an 8GB memory card. Probably also works fine on a Raspberry Pi 3.

Steps

Download the latest Raspbian Jessie Light image. Earlier versions of Raspbian won't work.

Write it to a memory card using Etcher, put the memory card in the RPi and boot it up.

@roadsideseb
roadsideseb / async_schedule.py
Last active August 11, 2022 09:49
A slightly modified version of the 'schedule' Python package that works with asyncio 😎
import emoji
import schedule
import asyncio
import inspect
from datetime import datetime
class Job(schedule.Job):
@dimi-tree
dimi-tree / 01_models.py
Last active November 17, 2020 07:16
Django REST Framework: understaning ModelSerializer
from django.db import models
class Member(models.Model):
# RE: null vs blank
#
# NULL https://docs.djangoproject.com/en/1.10/ref/models/fields/#null
# Avoid using null on string-based fields such as CharField and TextField because
# empty string values will always be stored as empty strings, not as NULL.
#
@btroncone
btroncone / ngrxintro.md
Last active September 5, 2025 05:30
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents