Skip to content

Instantly share code, notes, and snippets.

View imsickofmaps's full-sized avatar

Mike Jones imsickofmaps

View GitHub Profile
@imsickofmaps
imsickofmaps / django_markdown.py
Created April 2, 2020 13:21 — forked from hakib/django_markdown.py
Using Markdown in Django
# Source code for article:
# https://hakibenita.com/django-markdown
from typing import Optional
import re
import markdown
from markdown.inlinepatterns import LinkInlineProcessor, LINK_RE
from urllib.parse import urlparse
from django.core.exceptions import ValidationError
[email protected] /Users/mikej/Documents/glcode/picsa-os/web_internal
├─┬ @dump247/[email protected]
│ └─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected] deduped
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ ├── [email protected] deduped
│ │ ├── [email protected]
diff --git a/core_data/files/templates/footer_afr_za.html b/core_data/files/templates/footer_afr_za.html
index b4f385a..4edd772 100644
--- a/core_data/files/templates/footer_afr_za.html
+++ b/core_data/files/templates/footer_afr_za.html
@@ -1,6 +1,10 @@
<table class="bump-top form-call-to-action">
<tr>
+ {% if request.GET.basic == "true" %}
+ <td>Gee asb. die voltooide vorm vir jou personeelbestuurder om vir ons te stuur. Vir enige vrae, kontak asb. jou personeel bestuurder.</td>
+ {% else %}
amqp==2.3.2
aniso8601==3.0.2
apipkg==1.5
appnope==0.1.0
asn1crypto==0.24.0
atomicwrites==1.2.0
attrs==18.1.0
aws-xray-sdk==0.95
beautifulsoup4==4.6.0
billiard==3.5.0.4
import string
import random
def id_generator(size=4, chars=string.ascii_uppercase + string.ascii_lowercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
amqp==2.3.2
aniso8601==3.0.0
appnope==0.1.0
asn1crypto==0.24.0
atomicwrites==1.1.5
attrs==18.1.0
aws-xray-sdk==0.95
beautifulsoup4==4.6.0
billiard==3.5.0.3
bleach==2.1.1
diff --git a/web_internal/src/components_v2/impact-report-investments-section/index.js b/web_internal/src/components_v2/impact-report-investments-section/index.js
index fb84181..c9c23a4 100644
--- a/web_internal/src/components_v2/impact-report-investments-section/index.js
+++ b/web_internal/src/components_v2/impact-report-investments-section/index.js
@@ -14,7 +14,6 @@ import React from 'react'
import PropTypes from 'prop-types'
import { graphql } from 'react-apollo'
import gql from 'graphql-tag'
-import moment from 'moment'
products = ["savings", "loans", "insurance"]
agents = ["person1", "person2"]
i = 1
for product in products:
k = 1
for people in agents:
no_of_cases_to_create = k + i
print(product, people)
for c in range(no_of_cases_to_create):
# 1. Post CSV to a secret gist
# 2. Grab the link to the raw version
# 3. Run the following on the server
import csv
import io
import requests
url = "http://gist" # replace
file = io.StringIO(requests.get(url).text)
class DeliverHook(Task):
def run(self, target, payload, instance_id=None, hook_id=None, auth_token=None, **kwargs):
"""
target: the url to receive the payload.
payload: a python primitive data structure
instance_id: a possibly None "trigger" instance ID
hook_id: the ID of defining Hook object
"""
headers = {
'Content-Type': 'application/json'