Instantly share code, notes, and snippets.

View activation.txt
Ubuntu
Add the following in /etc/hosts
0.0.0.0 account.jetbrains.com
Windows
Add the following in C:\Windows\System32\drivers\etc\hosts
0.0.0.0 account.jetbrains.com
Open Pycharm/WebStorm and enter following as activation code
View census.csv
We can't make this file beautiful and searchable because it's too large.
View olympics.csv
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
№ Summer 01 ! 02 ! 03 ! Total № Winter 01 ! 02 ! 03 ! Total № Games 01 ! 02 ! 03 ! Combined total
Afghanistan (AFG) 13 0 0 2 2 0 0 0 0 0 13 0 0 2 2
Algeria (ALG) 12 5 2 8 15 3 0 0 0 0 15 5 2 8 15
Argentina (ARG) 23 18 24 28 70 18 0 0 0 0 41 18 24 28 70
Armenia (ARM) 5 1 2 9 12 6 0 0 0 0 11 1 2 9 12
Australasia (ANZ) [ANZ] 2 3 4 5 12 0 0 0 0 0 2 3 4 5 12
Australia (AUS) [AUS] [Z] 25 139 152 177 468 18 5 3 4 12 43 144 155 181 480
Austria (AUT) 26 18 33 35 86 22 59 78 81 218 48 77 111 116 304
Azerbaijan (AZE) 5 6 5 15 26 5 0 0 0 0 10 6 5 15 26
View invoice.json
{
"id": "in_1CtAW6EJm399uiqN75nU7uDk",
"object": "invoice",
"amount_due": 210,
"amount_paid": 0,
"amount_remaining": 210,
"application_fee": null,
"attempt_count": 0,
"attempted": false,
"auto_advance": true,
View a.html
html file(index.html)
{% extends 'base.html' %}
{% block content %}
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#image_Modal">Add Image</button>
View scene_number.py
# image create view
if form.is_valid():
images = Image.objects.order_by('-_id').all()
if len(images)>0:
# get latest image scene number
scene_number = Images.first().scene_number + 1
else:
# creating first image so set scene_number =1
scene_number = 1
View image_edit.js
# add this js file /static/js/image_edit.js
$(document).ready(function(){
var width = window.innerWidth;
var height = window.innerHeight;
function update(activeAnchor) {
var group = activeAnchor.getParent();
var topLeft = group.get('.topLeft')[0];
View template.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<h1>Images</h1>
<table>
{% for image in object_list %}
<tr>
View fileupload.py
# convert image and video fields to StringField() in models.py
# remove type field from models.py and forms.py as well
# view.py changes
# create_image view
image = form.save()
image_file = request.FILES['image']
View company_profile.json
{
"id": 1,
"name": "Meri Company",
"street": "",
"city": "",
"state": "",
"country": "",
"lat": "0.00000000000000000000",
"lng": "0.00000000000000000000",
"site_url": "",