Skip to content

Instantly share code, notes, and snippets.

View lezorich's full-sized avatar

Lukas Zorich lezorich

View GitHub Profile
from django.db import models
from django.db.models import signals
from django.contrib.admin.utils import NestedObjects
class AppQuerySet(models.QuerySet):
def delete(self, **kwargs):
return self.update(is_void=True)
class AppManager(models.Manager):
queryset_class = AppQuerySet
nebil /
Last active August 10, 2023 19:42
🎨 The opinionated Git styleguide — with emoji! 🎨

Git – styleguide


_A styleguide is about consistency. Consistency with this styleguide is important. [...]
However, know when to be inconsistent -- sometimes the styleguide just doesn’t apply.
When in doubt, use your best judgment.

bryanstern /
Last active April 24, 2022 03:17
An OkHttp backed HttpStack for Volley
* The MIT License (MIT)
* Copyright (c) 2015 Circle Internet Financial
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
Brainiarc7 / prime-select PKGBUILD for Arch Linux
Last active November 11, 2018 15:16
Enable NVIDIA PRIME's selector on Arch Linux
View prime-select PKGBUILD for Arch Linux
# Maintainer: Dennis E. Mungai <>
pkgdesc="Tools to enable NVIDIA's Prime."
arch=('x86_64' 'i686')
depends=('lightdm' 'bbswitch' 'python' 'bash')
optdepends=('nvidia' 'lightdm-gtk3-greeter')
eduardb /
Last active May 26, 2023 00:07
Uploading a file with a progress displayed using OkHttp
public class CountingFileRequestBody extends RequestBody {
private static final int SEGMENT_SIZE = 2048; // okio.Segment.SIZE
private final File file;
private final ProgressListener listener;
private final String contentType;
public CountingFileRequestBody(File file, String contentType, ProgressListener listener) {
this.file = file;
chrisbanes /
Last active March 31, 2023 04:44
* Copyright 2014 Chris Banes
* 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
* Unless required by applicable law or agreed to in writing, software