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
@Brainiarc7
Brainiarc7 / prime-select PKGBUILD for Arch Linux
Last active November 11, 2018 15:16
Enable NVIDIA PRIME's selector on Arch Linux
# Maintainer: Dennis E. Mungai <dmngaie@gmail.com>
pkgname=nvidia-prime
pkgver=0.7
pkgrel=1
pkgdesc="Tools to enable NVIDIA's Prime."
url="https://launchpad.net/ubuntu/+source/nvidia-prime"
arch=('x86_64' 'i686')
license=('GPLv3')
depends=('lightdm' 'bbswitch' 'python' 'bash')
optdepends=('nvidia' 'lightdm-gtk3-greeter')
@bryanstern
bryanstern / OkHttpStack.java
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
@eduardb
eduardb / CountingFileRequestBody.java
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;
@nebil
nebil / styleguide-en.md
Last active August 10, 2023 19:42
🎨 The opinionated Git styleguide — with emoji! 🎨

Git – styleguide

Rationale

_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.

@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active March 15, 2024 06:39
FloatLabelLayout
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software