Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am dmtmov on github.
  • I am dmtmov (https://keybase.io/dmtmov) on keybase.
  • I have a public key whose fingerprint is B729 52FC 0A60 7D6B 18E8 7003 4953 6323 04D0 8FA6

To claim this, I am signing this object:

#!/usr/bin/env python3
"""
The script exports of Pinnacle data from the given Patient sources.
It takes 2 arguments:
:input_path: (str) - The path to folder of Patient source files;
:output_directory: (str) - The output files of this tool for Patient;
Settings:
Running 11.94 km ███████████████████ 7.67/h
Swimming 0.00 km ░░░░░░░░░░░░░░░░░░░ 0.00/h
Cycling 0.00 km ░░░░░░░░░░░░░░░░░░░ 0.00/h
Last month 11.94 km 2:33h
@dmtmov
dmtmov / gist:7f72da7dd9310e858132183549dbb517
Created June 11, 2020 14:49
urllib3 multipart/form-data
import urllib3
r = http.request(
'POST',
'https://example.com/createRecord',
fields={
'foo': 'bar',
'your_field': ('filename.tar.gz', open('full/path/filename.tar.gz', 'rb').read())
})
print(r.data)
@dmtmov
dmtmov / Django + Ajax dynamic forms .py
Created November 18, 2019 22:41 — forked from goldhand/Django + Ajax dynamic forms .py
Django form with Ajax. A simple Task model that can be updated using a CBV with an AJAX mixin. The view sends post data with ajax then updates the view with a callback to a DetailView with a json mixin.There is an abstract CBV, AjaxableResponseMixin, based on the example form django docs, that is subclassed in the TaskUpdateView CBV. TaskUpdateV…
#models.py
class Task(models.Model):
title = models.CharField(max_length=255)
description = models.TextField()
def __unicode__(self):
return self.title