Skip to content

Instantly share code, notes, and snippets.

View blarghmatey's full-sized avatar

Tobias Macey blarghmatey

View GitHub Profile
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')
0466268b7253ab8cd37274fa434274c7286ab7e6618bfb1e9852e63c3b8737298977409abdec4717d67208ef1513f22eaeaf06d7919893f55c4e0cfde8b41e9cfe;shaidar
{%- 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 -%}
{%- 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 -%}
@blarghmatey
blarghmatey / keybase.md
Created May 3, 2015 12:35
Keybase Proof

Keybase proof

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:

@blarghmatey
blarghmatey / PyCon Proposal.md
Last active August 29, 2015 14:05
PyCon 2015 Talk Proposal - Python for Polyglots

Title - Python for Polyglots

Category - Other

Duration - 30 minutes

Description

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.

@blarghmatey
blarghmatey / package_sync.el
Last active August 29, 2015 14:00
Emacs Package Synchronization
(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))))