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
// ==UserScript== | |
// @name KonText Interface Layout Switcher | |
// @namespace https://trnka.korpus.cz/~lukes | |
// @version 0.1.2 | |
// @description turns the KonText topbar into a sidebar, adds a query box | |
// @author David Lukeš | |
// @match https://kontext.korpus.cz/* | |
// @grant none | |
// @require http://code.jquery.com/jquery-latest.js | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js |
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
// ==UserScript== | |
// @name KonText Interface Layout Switcher | |
// @namespace https://trnka.korpus.cz/~lukes | |
// @version 1.0.0 | |
// @description turns the KonText topbar into a sidebar, adds a query box | |
// @author David Lukeš | |
// @match https://kontext.korpus.cz/* | |
// @grant none | |
// @require http://code.jquery.com/jquery-latest.js | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js |
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
<!-- How to have a div stretch between divs on the left and right. Useful e.g. for --> | |
<!-- Bootstrap navbar et al. --> | |
<style> | |
.inner-navbar { | |
border: 2px solid black; | |
padding: 5px; | |
width: 100%; | |
} | |
.left { |
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
# Case-insensitive, diacritic-sensitive collation with MySQL demo | |
# | |
# Dependencies -- install ``python3``, then: | |
# | |
# $ pip3 install --user pymysql sqlalchemy | |
# | |
# Replace <user>, <passwd> and <db> in the create_engine() URL with suitable | |
# values corresponding to your local MySQL setup. | |
# | |
# Usage: |
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
/* With regular functions, `this` is bound purely depending on how the function is called. If it's | |
* bound to an object (either explicitly or via the `instance.funcName()` sugar), `this` refers to | |
* that object. Otherwise, it's `undefined` (or `window`, depending on your exact environment and | |
* whether `"use strict";` is in effect). | |
* | |
* In particular, it doesn't matter whether the function is attached to the object itself as a | |
* property, i.e. each instance has its own version of the function created during initialization, | |
* (see `Class2`), or whether it exists on the object's `prototype` as a method and all instances | |
* share it (see `Class1`). `this` is always resolved dynamically, i.e. depending on the call site. | |
* Neither of these is well suited for yanking out of the context of the original object and using |
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
#!/usr/bin/env python3 | |
import time | |
import subprocess as sp | |
import concurrent.futures as cf | |
start = time.time() | |
with cf.ThreadPoolExecutor() as e: | |
futures = [e.submit(sp.check_output, f"sleep 2s && echo Done {i}.", shell=True) for i in range(3)] |
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
// ==UserScript== | |
// @name CNC Toolbar Links | |
// @namespace https://trnka.korpus.cz/~lukes | |
// @version 0.2 | |
// @description Make CNC toolbar links open in new windows / tabs. | |
// @author David Lukeš | |
// @match http*://*.korpus.cz/* | |
// @match http*://korpus.cz/* | |
// @grant none | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js |
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
// ==UserScript== | |
// @name KonText Interface Layout Switcher | |
// @namespace https://trnka.korpus.cz/~lukes | |
// @version 3.2.0 (for KonText v0.9.x) | |
// @description Adds a quick query box to KonText above the concordance | |
// @author David Lukeš | |
// @match https://kontext.korpus.cz/* | |
// @grant none | |
// @require http://code.jquery.com/jquery-latest.js | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js |
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
#!/usr/bin/env python3 | |
"""List packages explicitly installed with pacman or pacaur.""" | |
import re | |
from collections import namedtuple | |
from subprocess import check_output | |
Package = namedtuple("Package", "date name") |
OlderNewer