View pyproject.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tool.poetry] | |
name = "poetry-demo" | |
version = "0.1.0" | |
description = "" | |
authors = ["gonvaled"] | |
[tool.poetry.dependencies] | |
python = "^3.6" | |
dj-database-url = "^0.5.0" | |
Django = "^2.0.7" |
View forms.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.forms import ModelForm, FileField | |
from .models import Campaign | |
from .widgets import ImagePreviewWidget | |
class DesignCampaignForm(ModelForm): | |
brand_logo = FileField(widget=ImagePreviewWidget) |
View data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"nodes":[ | |
{"x":80, "r":40, "label":"Node 1"}, | |
{"x":200, "r":60, "label":"Node 2"}, | |
{"x":380, "r":80, "label":"Node 3"} | |
]} |
View get_closure.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import httplib | |
import sys | |
import urllib | |
from contextlib import closing | |
################################################################################################################ | |
# Compilation level | |
WHITESPACE_ONLY_CL = 'WHITESPACE_ONLY' | |
SIMPLE_OPTIMIZATIONS_CL = 'SIMPLE_OPTIMIZATIONS' |
View gist:2429165
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
server="localhost:9200" | |
index="my_index" | |
river1="first_river" | |
host1="localhost" | |
port1="5984" | |
db1="firstdb" | |
type1="firsttype" |
View gist:1688268
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server="localhost" | |
printf "\n\nCreate the index\n" | |
curl -XPUT "$server:9200/index1" | |
printf "\n\nCreate the mapping\n" | |
curl -XPUT "$server:9200/index1/mapping1/_mapping" -d '{ | |
"type1" : { | |
"dynamic" : false, | |
"properties" : { |