Skip to content

Instantly share code, notes, and snippets.

@brabect1
brabect1 / custom_coverpage.rst
Created January 28, 2024 20:06
Custom cover page with LaTeX memoir class.

Custom Coverpage with LaTeX memoir

Example showing use of custom cover page with memoir class of article class option. There are some few "tricks" to yield the desired effect.

@brabect1
brabect1 / git_commit_transfer.rst
Last active January 1, 2024 19:40
Shows how to export and import Git repository. #git #export #import #patch
@brabect1
brabect1 / advanced_tcl.rst
Last active January 20, 2024 08:14
Some advanced Tcl topics #tcl

Advanced Tcl Topics

This gist covers some areas that go beyond basic Tcl use. These are useful for anyone embarking on more complex Tcl programming. Some of the topics are fairly simple but very little advertised in Tcl snippets or tutorials.

Boolean Variables

@brabect1
brabect1 / ocv_timing_derate.rst
Last active March 24, 2024 11:26
OCV and timing derating #sta

OCV and Timing Derating

Attribution

@brabect1
brabect1 / tcl_ns_ensemble.rst
Last active October 16, 2022 19:08
About Tcl ensembles #tcl #namespace #ensemble

Tcl Namespace Ensemble

Tcl ensemble is a dispatcher command. If you oversimplify, you can think of it as an alias. What a dispatcher command does is that it calls another command along with all arguments. Here is an example:

# everbody knows a `file` command, right
file dirname [pwd]
@brabect1
brabect1 / tcltest_tutorial.rst
Last active July 17, 2022 19:29
#tcl #tcltest

tcltest Tutorial

Based in greater part on the tcltest tutorial series by Hai Vu.

What is tcltest

tcltest is a Tcl package providing a unit testing framework. It provides both the unit test API and the test (suite) runner. A unit test is then a Tcl scripts that includes ::tcltest and uses its API

@brabect1
brabect1 / custom_parsers.rst
Last active August 24, 2022 23:02
Custom parsers in Python #python

Custom Parsers in Python

For more complete overview see https://tomassetti.me/parsing-in-python/

pyleri

pyleri is good for simple things. It is limited by regex syntax at intersection of its supported languages. Hence it does not allow multi-line matches despite e.g. Python's support. This makes certain syntax

@brabect1
brabect1 / huddle_usage.rst
Last active March 14, 2024 15:21
Using Tcl Huddle serialization format. #tcl #huddle

Tcl Huddle

Tcllib's ::huddle is a native serialization format and is part of its YAML package. ::huddle's function is the same as of JSON or YAML; that is to augment commond data types along with the data. When JSON or YAML get parsed into an interpretter, individual data get represented by its native type; that is, string becomes a string, list becomes a list, map becomes a map/hash/dictionary, etc.

In Tcl, the problem is that all these types are mostly interchangeble (which is normally

@brabect1
brabect1 / tcl_reuse_components.rst
Last active July 15, 2023 13:07
Tcl Modules and Packages #tcl