Skip to content

Instantly share code, notes, and snippets.

View balavec's full-sized avatar
😎
Working on a migration to Plone 5.2

Robert Kuzma balavec

😎
Working on a migration to Plone 5.2
View GitHub Profile
@balavec
balavec / delete_local_branches.sh
Created July 29, 2019 12:33 — forked from TSMMark/delete_local_branches.sh
Delete local branches that don't exist remotely
git fetch --all -p; git branch -vv | grep ": gone]" | awk '{ print $1 }' | xargs -n 1 git branch -D
@balavec
balavec / curl.md
Created June 5, 2020 09:34 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@balavec
balavec / django_model_deletable.py
Created August 16, 2020 20:04 — forked from freewayz/django_model_deletable.py
Django check if model has related object before Deleting the model
#After looking for a way to check if a model instance can be deleted in django ,
#i came across many sample, but was not working as expected. Hope this solution can help.
#Let start by creating an Abstract model class which can be inherited by other model
class ModelIsDeletable(models.Model):
name = models.CharField(max_length=200, blank=True, null=True, unique=True)
description = models.CharField(max_length=200, blank=True, null=True)
date_modified = models.DateTimeField(auto_now_add=True)