- https://github.com/zyedidia/micro/blob/master/runtime/help/defaultkeys.md
- https://github.com/zyedidia/micro/blob/master/runtime/help/commands.md
- https://github.com/zyedidia/micro/blob/master/runtime/help/keybindings.md
Ctrl+E to open command panel
| function parse_json_date(json_date) | |
| local pattern = "(%d+)%-(%d+)%-(%d+)%a(%d+)%:(%d+)%:([%d%.]+)([Z%+%-])(%d?%d?)%:?(%d?%d?)" | |
| local year, month, day, hour, minute, | |
| seconds, offsetsign, offsethour, offsetmin = json_date:match(pattern) | |
| local timestamp = os.time{year = year, month = month, | |
| day = day, hour = hour, min = minute, sec = seconds} | |
| local offset = 0 | |
| if offsetsign ~= 'Z' then | |
| offset = tonumber(offsethour) * 60 + tonumber(offsetmin) | |
| if xoffset == "-" then offset = offset * -1 end |
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| # | |
| # Copyright (C) 2025 Red Dove Consultants Limited. License: 3-Clause BSD. | |
| # | |
| import argparse | |
| import logging | |
| import os | |
| import subprocess | |
| import sys |
| #!/bin/bash | |
| # ====================================================== | |
| # by rvk (v.2.1, 2024-12-06) | |
| # ====================================================== | |
| echo "" | |
| echo "==============================================================" | |
| echo "Running on: $(sed 's/\x0/ /' /sys/firmware/devicetree/base/model 2>/dev/null || cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null || echo Unknown)" | |
| # ====================================================== |
| ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞══════════════════════ | |
| The following assertion was thrown during performLayout(): | |
| RenderCustomMultiChildLayoutBox object was given an infinite size | |
| during layout. | |
| This probably means that it is a render object that tries to be | |
| as big as possible, but it was put inside another render object | |
| that allows its children to pick their own size. | |
| The nearest ancestor providing an unbounded height constraint is: RenderFlex#0fb98 relayoutBoundary=up2 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE: | |
| parentData: offset=Offset(0.0, 0.0) (can use size) | |
| constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=614.0) |
Let's say contributor has submitted a pull request to your (author) project (repo). They have made changes on their
branch feature and have proposed to merge this into origin/master, where
origin -> https://github.com/author/repo.gitNow say you would like to make commits to their PR and push those changes. First, add their fork as a remote called
| # From https://stackoverflow.com/questions/6167587 | |
| class EnhancedRotatingFileHandler(logging.handlers.TimedRotatingFileHandler): | |
| def __init__(self, filename, when='h', interval=1, backupCount=0, encoding=None, delay=0, utc=0, maxBytes=0): | |
| """ This is just a combination of TimedRotatingFileHandler and RotatingFileHandler (adds maxBytes to TimedRotatingFileHandler) """ | |
| logging.handlers.TimedRotatingFileHandler.__init__(self, filename, when, interval, backupCount, encoding, delay, utc) | |
| self.maxBytes=maxBytes | |
| def shouldRollover(self, record): | |
| """ | |
| Determine if rollover should occur. |
| <div id="my-unique-id" hx-history-preserve> | |
| <p>Markup here wil be returned to it's original state on history restore.</p> | |
| </div> |
| htmx.on('htmx:beforeSwap', (htmxEvent) => { | |
| let incomingDOM = new DOMParser().parseFromString(htmxEvent.detail.xhr.response, "text/html"); | |
| // Transpose <meta> data, page-specific <link> tags and JSON-LD structured data | |
| // Note that hx-boost automatically swaps the <title> tag | |
| let selector = "head > meta:not([data-revision]), head *[rel=\"canonical\"], head *[rel=\"alternate\"], body script[type=\"application/ld+json\"]"; | |
| document.querySelectorAll(selector).forEach((e) => { | |
| e.parentNode.removeChild(e); | |
| }); | |
| incomingDOM.querySelectorAll(selector).forEach((e) => { | |
| if (e.tagName === 'SCRIPT') { |
| from __future__ import annotations | |
| import asyncio | |
| import datetime | |
| import sys | |
| import time | |
| from textual.app import App, ComposeResult | |
| from textual.containers import Container, Horizontal, Vertical | |
| from textual.widgets import DataTable, Footer, Label |