Skip to content

Instantly share code, notes, and snippets.

View niespodd's full-sized avatar
🧩
Focusing

Dariusz Niespodziany niespodd

🧩
Focusing
View GitHub Profile
import re
import zlib
from datetime import datetime
from decimal import Decimal
def get_value_from_line(fields, line_no):
for field in fields:
if field['field_line'] == line_no:
return field['field_text']
@niespodd
niespodd / lang_switcher.py
Created February 10, 2019 18:46
dj i18n lang switcher template tag
register = Library()
@register.simple_tag(takes_context=True)
def change_lang(context, lang=None, *args, **kwargs):
try:
request = context.get('request')
path = request.path
url_parts = resolve(path)
@niespodd
niespodd / package.json
Last active May 8, 2023 09:07
Making web3/bitcore-lib work with Angular 6-11 and >=11
{...
"scripts": {
"postinstall": "node patch.js",
...
}
}
@niespodd
niespodd / onclick.js for end screen
Created October 28, 2017 18:12
Escape TypeForm with form_id without premium, enjoy.
javascript:(function(){top.window.location='http://foo.bar/co?tf_id='+typeform.submissionRepository.token.split("$")[0];})();