Skip to content

Instantly share code, notes, and snippets.

@jdittrich
jdittrich / convertToOtranscribe.py
Last active August 26, 2022 10:22
hacky little script to convert plain text transcripts that have timestamps in the beginning of lines into documents that can be imported to otranscribe (https://otranscribe.com/)
"""
hacky little script to convert plain text transcripts
that have timestamps in the beginning of lines
into documents that can be imported to otranscribe
The file format it takes looks like:
1:30 I mean yeah uhm
1:32 I dunno
@jdittrich
jdittrich / PollutionAndDanger.my
Created March 14, 2022 11:22
Notes from Mary Douglas’ Pollution and Danger
2 Dirt is disorder, disorder is subjective
3 removing dirt is ordering the environment creatively
4 people violating the moral code can cause harm; they are treated as infectious
4 relations and pollution between people mirror that of society
5 "For I believe that ideas about separating, purifying, demarcating and punishing transgressions have as their main function to impose system on an inherently untidy experience." "It is only by exaggerating the difference between within and without, about and below, male and female, with and against, that a semblance of order is created. In this sense I am not afraid of the charge of having made the social structure seem over-rigid."
@jdittrich
jdittrich / pythonWebAppsArchitecture.md
Last active March 13, 2022 22:12
Architecture Resources for Web Applications in Python
@jdittrich
jdittrich / test_transcript.py
Last active April 7, 2022 12:53
Vosk Speech API modified test_simple.py: instead of returning a JSON it returns lines of text: MM:SS,texttexttext # so you can use them in a transcript or for close captions
#!/usr/bin/env python3
# based on https://github.com/alphacep/vosk-api/blob/master/python/example/test_simple.py
# by alphacep under Apache 2.0
# modifications by Jan D.
# instead of returning a JSON it returns lines of text: MM:SS,texttexttext
# so you can use them in a transcript or for close captions
# (for the code below to work you need python 3 and pipenv installed. If you do not have pipenv, do
# $ pip install --user pipenv
#
# The lines that start with $ mean that the text of the line after the $ is put in the terminal and executed (press Enter).
@jdittrich
jdittrich / Understanding Taguette with Sourcetrail.md
Created November 20, 2021 17:28
Understanding Taguette with Sourcetrail
  • Download sourcetrail and run it
  • Set the taguette’s poetry (taguette’s designated package manager) Script folder as your environment (under Windows, it is at User/foo/AppData/Local/pypoetry/Cache/virtualenvs/taguette-bar/Scripts – where foois your username andbar` some gibberish. The environment is thus not in your taguette folder!)
  • Set the root taguette repo folder as folder to index (not the /taguette subfolder, where most of the .py files are!)
  • Exclude the /taguette/migrations folder
  • Let Sourcetrail index the repo. Depending on your computer’s power, it might take a few minutes.
  • Start exploring the code

Start reading at base.py, class BaseHandler. BaseHandler inherits from Tornado’s Request handler. BaseHandler has some more methods that get self and call super. These are extended methods of Tornado’s requestHandler.

What the files do:

(particularly relevant files are in bold)

  • Folder: Web
    • __init__: make_app creates the application and connectes the URLs to the respective views and API endpoints.
  • api: API responses. Change data via commands. Data as well as commands are pulled via the functi
@jdittrich
jdittrich / Debugging Taguette with PyCharm.md
Created November 16, 2021 20:31
A gist that describes how

Debugging Taguette with PyCharm (tested for PyCharm 2021.2)

  1. Install the poetry plugin for pycharm: https://plugins.jetbrains.com/plugin/14307-poetry
  2. in PyCharm’s menu: Run/Edit Configurations
  3. Add a new configuration by clicking the top-left plus icon on by pressing alt+insert on your keyboard.
  4. Select Python in the pop-up list (other options that show are shell, python test, compund etc.)
  5. In the main configuration window 5.1. In Module Name type taguette.main 5.2. In Environment, Python interpreter, choose "Poetry (taguette)"
@jdittrich
jdittrich / objectivity
Created February 28, 2021 22:32
Notes for "Objectivity", Daston, Galison
18  Truth to nature (underlying form) → Objectivity (mechanical product) → Trained judgment
19 Working Objects: Atlas Images, Type Specimens, Lab processes
29 Objectivity used to mean the opposite. With Kant came the now familiar objective=nature
31f objectivity as part of the tradition to examine 'obstacles to knowledge'
34 ""Man of science" began to fret openly about a new kind of obstacle to knowledge: themselves"
@jdittrich
jdittrich / undoRedo.js
Last active January 17, 2021 20:37
A simple ES6 undo-redo library, consisting of a command stack class and a command class template.
/*
LICENSE:
The MIT License (MIT)
Copyright © 2021 Jan Dittrich
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
5 computers are like the Rorschach-Test
10 Interacting with computers is seductive: Total control and no mess of social relations
13 Computers evoke rather than determine thinking
13 opacity of computers encourages to talk about them
20 Kids argue about "do computers think"
20 Kids know themselves and attribute what they know about them to things (childhood animism)
20 usually: material OR Psychological but computers are both
20 computers are "marginal Objects" – are they "in" or "out" e.g. of "living things"
22 Computers for exploring power, life, death: Switch them on, off, break, crash
23 Horrors of recursion and infinity