Skip to content

Instantly share code, notes, and snippets.

View premchalmeti's full-sized avatar
🎯
Focusing

Premkumar Chalmeti premchalmeti

🎯
Focusing
View GitHub Profile
@perrygeo
perrygeo / django_model_graph.sh
Created April 13, 2013 21:44
Generate UML diagram of django app models
apt-get install python-pygraphviz
pip install django-extensions
# add 'django_extensions' to INSTALLED_APPS in settings.py
python manage.py graph_models trees -o test.png
@mk123
mk123 / cookies.md
Last active September 21, 2020 16:49
Angular 2 and django integration with CORS and cookies

How to enable cookies when using angular 2 and django rest framework.

To enable cross origin requests i.e. requests from different servers to django rest framwework api we need to use the following library.
Django CORS
The above link will tell you about most of the configurations but misses some of them which I think are specific to angular 2.

Assuming your django server is running on localhost:8000 and angular 2 server is running on localhost:4200 (your servers might be running on different ports so set accordingly, make following changes in setting.py file of your django project.

@Rajeshr34
Rajeshr34 / wkhtmltopdf.sh
Last active July 8, 2024 05:42
Wkhtmltopdf With Patched QT Setup Ubuntu 16+
cd ~
apt-get install libfontenc1 xfonts-75dpi xfonts-base xfonts-encodings xfonts-utils openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig -y
#https://github.com/wkhtmltopdf/wkhtmltopdf/releases
#replace arch
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
apt --fix-broken install
@yajra
yajra / install-wkhtmltopdf.sh
Last active June 12, 2024 11:12
Install wkhtmltopdf 0.12.4 (with patched qt)
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
mv wkhtmltox/bin/wkhtmlto* /usr/bin/
ln -nfs /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
@clarkenheim
clarkenheim / Zip Codes to DMAs
Last active June 5, 2024 16:34
TSV file containing zip codes and the DMA they fall in to. Method: calculate the centre point of every zip code geo boundary, plot those points on a DMA boundary map, find the containing DMA of each zip centroid
This file has been truncated, but you can view the full file.
zip_code dma_code dma_description
01001 543 SPRINGFIELD - HOLYOKE
01002 543 SPRINGFIELD - HOLYOKE
01003 543 SPRINGFIELD - HOLYOKE
01004 543 SPRINGFIELD - HOLYOKE
01005 506 BOSTON (MANCHESTER)
01007 543 SPRINGFIELD - HOLYOKE
01008 543 SPRINGFIELD - HOLYOKE
01009 543 SPRINGFIELD - HOLYOKE
01010 543 SPRINGFIELD - HOLYOKE