Posts

Oclif and Vite

Incompatibility with CLI Build

If you intend to build out an Oclif typescript CLI app that is to be consumed by Vitejs, you might experience an issue with integrating the two. The Oclif CLI builds properly, but when executing the CLI through vite, this errors comes up.

[ERR_UNKNOWN_FILE_EXTENSION] TypeError Plugin: ... [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" ...
Categories: #shell #typescript
Tags: #NodeJs
PyQT - Collapsible Sections

PyQt - Accordion Equivalent

When there are groups of related information that are to be made available for viewing, but is too visually cluttering when shown all at once, one can use the grouping behavior of an accordion or collapsible section to selectively show information.

One native Qt widget that can be used in PyQT is the QtToolBox. This widget offers a vertical list of collapsible containers where only one can be viewed at a time. It behaves similar to a tab view except the the tab and its associated content are bunched together.

Categories: #python
Tags: #pyqt
PyQtgraph - Graphing with a Ui File

PyQtgraph Graph in Native Window

Dedicating a UI file to store the application layout will make for a more organized process when working with PyQt. The Python code will be cleaner if it focuses on creating the dynamic data that will be inserted into the ui file.

To demonstrate this, create a window.ui file.

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>MainWindow</class>
 <widget class="QMainWindow" name="MainWindow">
  <property name="windowTitle">
   <string>MainWindow</string>
  </property>
  <widget class="QWidget" name="centralwidget">
     <layout class="QVBoxLayout" name="verticalLayout">
     </layout>
  </widget>
 </widget>
</ui>
Categories: #python #shell
Tags: #cli-tools
fzf - Integrate with Jq for JSON Search

Fzf Search JSON Data

JSON is a ubiquitous data format and searching for content in JSON will come up often enough to warrant a real-time search functionality. jq can be used to query json and fzf can be combined with this tool to fulfill our JSON search capabilities.

Start fzf with jq

echo '' | fzf --preview "jq {q} < us-data.json.json"
Categories: #fzf
Tags: #cli-tools