Sometimes we find ourselves needing to write a program in a language that gasp! isn't Python. Laying the groundwork to debug your mental model using a toy Python implementation can make it easier to determine the best path forward.
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
(defun installed-packages () | |
"Return the list of installed packages." | |
(mapcar 'car package-alist)) | |
(defun save-package-list () | |
"Save the list of installed packages to a file." | |
(interactive) | |
(with-temp-file "~/Dropbox/.emacs-packages-installed.el" | |
(insert (format "(defvar my-packages '%s)" 'installed-packages)))) | |
I hereby claim:
- I am blarghmatey on github.
- I am renaissancedev (https://keybase.io/renaissancedev) on keybase.
- I have a public key whose fingerprint is DFD1 205A 9826 9F34 C43C 9221 D626 0C61 6BD0 FA33
To claim this, I am signing this object:
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
{%- macro render_yaml(config_dict, offset=2) -%} | |
{%- for key, value in config_dict.items() -%} | |
{%- if value is mapping -%} | |
{{ key }}: | |
{{ render_yaml(value)|indent(offset) }} | |
{%- elif value is list -%} | |
{{ key }}: | |
{% for v in value -%} | |
- {{ v }} | |
{% endfor -%} |
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
{%- macro fluent_config_block(settings, offset=0) -%} | |
{%- for setting in settings %} | |
{{ ''|indent(offset, true) }}<{{ setting.directive }} {{ setting.get('directive_arg', '')}}> | |
{% for attr in setting.attrs -%} | |
{%- if 'nested_directives' in attr.keys() -%} | |
{{ fluent_config_block(attr.nested_directives, offset + 2) }} | |
{% else -%} | |
{{ attr.keys()[0]|indent(offset + 2, true) }} {{ attr.values()[0] }} | |
{% endif -%} | |
{% endfor -%} |
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
0466268b7253ab8cd37274fa434274c7286ab7e6618bfb1e9852e63c3b8737298977409abdec4717d67208ef1513f22eaeaf06d7919893f55c4e0cfde8b41e9cfe;shaidar |
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
from convert import (read_transcript, parse_srt_transcript, parse_text_transcript, | |
render_srt_transcript_to_vtt, render_text_transcript_to_html) | |
import click | |
from click import Path | |
@click.command() | |
@click.option('--filename', '-f', type=Path(exists=True), | |
help='Source transcript to be converted') |