This file contains hidden or 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
<?xml version="1.0"?> | |
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
> | |
<!-- | |
note : customfield_10002 may change depending on your jira setup. Inspect your xml output to insert the replace with the relevant field ID. | |
--> | |
<xsl:output method="html"/> | |
<xsl:template match="/"> | |
<style> |
This file contains hidden or 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 re | |
from django.utils.text import compress_string | |
from django.utils.cache import patch_vary_headers | |
from django import http | |
try: | |
import settings | |
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS |
This file contains hidden or 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
def myclass_factory(): | |
""" | |
Run this test with nosetests --with-doctest myclass.py | |
>>> myclass = myclass_factory() | |
>>> myclass.__private_attribute | |
Traceback (most recent call last): | |
... | |
AttributeError: 'MyClass' object has no attribute '__private_attribute' |
This file contains hidden or 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
<script src="{% static 'js/jquery.formset.js' %}"></script> | |
<script> | |
$(function () { | |
$('#myformset tbody tr').formset({ | |
'added': function (row) { | |
var widget = $(".autocomplete-light-widget", row); | |
widget.yourlabsWidget('destroy'); | |
widget.find('input').yourlabsAutocomplete('destroy'); | |
widget.trigger('initialize'); | |
} |
This file contains hidden or 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
def pause(self): | |
# helper for rconsole. This blocks ableton inside python on purpose, otherwise the console thread | |
# is super slow ( python interpreter is only active when needed ) | |
def lock(): | |
if self.console_event.isSet(): | |
return | |
# this trick works with Event and not with just time.sleep, because in python2 Event.wait is a loop+sleep, which keeps the interpreter busy | |
self.console_event.wait(0.1) | |
self.schedule_message(3, lock) |
This file contains hidden or 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
def reply_sysex(self, message): | |
from array import array | |
try: | |
raw = array('B') | |
raw.fromstring(message.encode('utf-16-le')) | |
raw = raw.tolist() | |
raw.insert(0, 240) | |
raw.append(247) | |
self._send_midi(tuple(raw), False) |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
import re | |
from collections import defaultdict | |
from functools import partial | |
i = """jio a, +18 | |
inc a | |
tpl a |
This file contains hidden or 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 dateutil.parser | |
import re | |
import sys | |
import pytz | |
tz = pytz.timezone("Europe/Vienna") | |
res = [] | |
for line in sys.stdin: |
This file contains hidden or 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
package com.company; | |
/** | |
java -cp . com.company.Main "4" "3" "2" | |
4 is even | |
3 is not even | |
2 is even | |
*/ |
This file contains hidden or 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
/* | |
solution to the second part of https://adventofcode.com/2020/day/23 | |
it executes in less than a minute in release mode, but it ain't pretty | |
main points: | |
- double linked list to easily insert/split/remove | |
- the nodes are not individual values, but ranges instead | |
- because looking up a value in a linked list takes so long, there is a hashmap pointing to the | |
slices for each value. everytime a slice is added or changed, all the values of the slice |
OlderNewer