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
/* A quick reminder on how to use Promises with Node and Express in order to run potentially | |
* time-consuming jobs asynchronously (assuming the jobs are able to run in the background thanks to | |
* libuv and actually return Promises). | |
* | |
* Start the server, navigate to /startjob, then refresh a few times, the job should be in progress. | |
* You can navigate elsewhere in the "app" in other browser tabs in the meanwhile (/). After about | |
* 20s, you should get a result by refreshing the tab where you originally submitted the job. | |
* | |
* I hope this pattern will be useful e.g. for processing images with the `sharp` library (see | |
* <http://sharp.dimens.io>). |
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
// ==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
<!-- 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
// ==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
// ==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
(* SETUP | |
1. Create an Application in Automator. | |
2. Add a Run AppleScript action. | |
3. Paste the content of this gist instead of the provided script skeleton. | |
4. Save the app, drag it to your dock and/or set it as the default app for | |
the filetypes of your choice using the Open With dialog in Finder. | |
NOTES ON USAGE |
NewerOlder