Skip to content

Instantly share code, notes, and snippets.

@ZipFile
ZipFile / python_descriptor_cheat_sheet.py
Last active June 13, 2018 05:39
Python descriptor cheat sheet
class StaticMethod:
def __init__(self, f):
self.f = f
def __get__(self, obj, cls=None):
return self.f
class ClassMethod:
def __init__(self, f):
@ZipFile
ZipFile / Dockerfile
Created August 4, 2018 20:39
Multistage build with private repo on GitHub. Python/Django app.
FROM ubuntu:bionic as build-base
ENV PYTHONUNBUFFERED 1
ARG SSH_KEY
RUN apt-get update && \
apt-get install -y build-essential \
libprotobuf-dev \
libhiredis-dev \
libxml2-dev \
@-moz-document url("chrome://browser/content/browser.xul") {
.tabbrowser-tab {
-moz-box-flex: 0 !important;
min-width: -moz-min-content !important;
}
.tabbrowser-tab[pending] {
opacity: 0.5 !important;
}
.tab-close-button, .tab-label-container, .tab-loading-burst {
display: none !important;
@ZipFile
ZipFile / wait_for_postgres.sh
Created March 4, 2019 13:52
Wait for postgres
#!/bin/bash
if [ -z "$DATABASE_URL" ]; then
echo "Missing database url"
exit 2
fi
RETRIES="${RETRIES:-10}"
echo -n "Waiting for postgres..."
@ZipFile
ZipFile / old-eh-category-buttons.css
Last active March 22, 2019 19:38
Old EH category buttons
.cs, .cn {
text-shadow: unset !important;
border: 1px solid var(--category-bg-color) !important;
color: black !important;
box-sizing: border-box !important;
letter-spacing: unset !important;
background:
linear-gradient(
to bottom,
white -25px,
@ZipFile
ZipFile / README.md
Created November 1, 2020 09:11
Calculate image signature in Python

Install dependencies

apt-get install libmagickwand-dev
pip install Wand

Usage

@ZipFile
ZipFile / history.yml
Created August 5, 2021 11:39
GitHub Actions
name: Git history
on: pull_request
jobs:
git-history:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 25
- name: "No fixup! commits"
@ZipFile
ZipFile / iqdb.py
Created April 4, 2021 15:50
IQDB-like image similarity calculation in Python
#!/usr/bin/env python
# Install deps:
# pip install scikit-image PyWavelets
# Run:
# python iqdb.py a.jpg b.jpg
# References:
# https://iqdb.org/code/
# https://github.com/ricardocabral/iskdaemon
# https://grail.cs.washington.edu/projects/query/
@ZipFile
ZipFile / README.md
Last active May 16, 2022 21:23
DIY stream testing
@ZipFile
ZipFile / Pixiv Public API.yaml
Last active August 7, 2022 14:11
Unofficial API specification extracted from Pixiv Android App
swagger: "2.0"
info:
title: "Pixiv Public API"
description: "Unofficial API specification extracted from Pixiv Android App v4.8.2"
version: "1.0"
host: public-api.secure.pixiv.net
schemes:
- https
basePath: /v1
produces: