Skip to content

Instantly share code, notes, and snippets.

Avatar

Readul Hasan Chayan heemayl

View GitHub Profile
@heemayl
heemayl / django_model_instance_clone_on_update.py
Created Oct 23, 2019
Django : clone model instance on update via a descriptor (used as a decorator on `save` method)
View django_model_instance_clone_on_update.py
class clone_on_update(object):
"""Descriptor to clone the model instance when any field
is updated. This is meant to be set as a decorator on `save`
method of the model.
Initialization Args:
- `condition` (str/callable) [Optional] (default: None)
- `active_status_field` (str) [Optional] (default: None)
- `update_one_to_one` (bool) [Optional] (default: True)
@heemayl
heemayl / script.gnp
Last active Nov 5, 2015
Basics of GNU Plot
View script.gnp
#!/usr/bin/env gnuplot
## We are plotting a time-series data, Time in `HH:MM` is separated by a space with their respective Number, you can think of the number as the Number of Users of an Application. Here is a snippet of the input file "input.txt" (remove the hashes, of course):
#12:00 2345
#12:15 5084
#12:30 2490
#12:45 3490
#13:00 4567
#13:15 4240
You can’t perform that action at this time.