Skip to content

Instantly share code, notes, and snippets.

View OnesimusUnbound's full-sized avatar

Marcelino Deseo OnesimusUnbound

View GitHub Profile
@OnesimusUnbound
OnesimusUnbound / README.md
Last active December 17, 2025 12:43
micro editor format command

Overview

format command changes the content of the file based on the file type and the formatter command associated with the file type.

How to Set Up?

  1. Open ~\.config\micro\init.lua. Create new file when non-existent
  2. Modify init.lua. Refer to init.lua in this gist.
  3. Update ~\.config\micro\settings.json to add the formatters. I've tested only python, lua and html. Others may work 🙏

How to Add Other Formatters

  1. For other formatter not listed, refer to the documentation of the cli of the formatter.
@OnesimusUnbound
OnesimusUnbound / base.css
Created July 18, 2024 10:37
Classless CSS
/* Basic reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
line-height: 1.6;
@OnesimusUnbound
OnesimusUnbound / create_measurements.ps1
Created June 21, 2024 22:38
Generate measurements
param(
[int]$numRecords
)
$filename = "measurements.txt"
if ($numRecords -eq $null) {
Write-Host "Usage: create_measurements.ps1 <number of records to create>"
exit 1
}
@OnesimusUnbound
OnesimusUnbound / EnableAutocompletion.ps1
Last active June 10, 2024 00:15
Script to enable autocompletions of some console apps in powershell
# Ensure lalest versions of these command apps are installed. Some autocompletions have additional requirements as indicated
# requirement: Install-Module DockerCompletion -Scope CurrentUser
Import-Module DockerCompletion
# requirement: Install-Module npm-completion -Scope CurrentUser
Import-Module npm-completion
helm completion powershell | Out-String | Invoke-Expression
kubectl completion powershell | Out-String | Invoke-Expression
@OnesimusUnbound
OnesimusUnbound / main.html
Created January 4, 2024 09:45
van.js simple todo app
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/yegor256/tacit@gh-pages/tacit-css.min.css"/>
<script type="module" src="main.js"></script>
<title>Document</title>
</head>
type Grade = A | B | C | D | E | F | InvalidGrade
let (|MoreThan|_|) grade value =
if value > grade then Some MoreThan else None
let (|LessThan|_|) grade value =
if value < grade then Some LessThan else None
let (|Between|_|) uppergrade lowergrade value =
if uppergrade >= value && value >= lowergrade then Some Between else None
@OnesimusUnbound
OnesimusUnbound / DesignPatterns.md
Last active December 19, 2015 18:38
List of .Net classes that use design patterns

NOTE

Items here are still in progress and I haven't determined with 100% certainty that the content is true. Please verify the content. ;-)

Creational

  • Abstract factory
  • System.Data.Common.DbProviderFactory
@OnesimusUnbound
OnesimusUnbound / Seven-Minute-Exercise-Notifier.ps1
Last active December 18, 2015 02:39
Powershell Script for Seven Minute Workout. Sends notification when the exercise or rest is done
$sound = New-Object System.Media.SoundPlayer;
function Initialize-Alert {
$sound.SoundLocation="$env:WINDIR\Media\ringout.wav";
}
function Alert-User {
$sound.Play();
}
@OnesimusUnbound
OnesimusUnbound / CommonlyUsedPosix.sh
Last active December 14, 2015 19:08
added unzip
TAR
tar -cf archive.tar foo bar # Create archive.tar from files foo and bar.
tar -tvf archive.tar # List all files in archive.tar verbosely.
tar -xf archive.tar # Extract all files from archive.tar.
# get line 5 to end, then print fifth column, sort, then get uniq.
sed -n '5,$p' <file> | gawk '{print $5}' | sort | uniq
# remove vss files within folder and sub folders
find . -iname '*.*scc' -type f -print0 | xargs -0 rm
@OnesimusUnbound
OnesimusUnbound / quote.txt
Last active September 3, 2024 12:53
Programming Quotes
[T]he difference between a bad programmer and a
good one is whether he considers his code or his
data structures more important. Bad programmers
worry about the code. Good programmers worry about
data structures and their relationships.
-- Linus Torvalds
~~~
Clarity and brevity sometimes are at odds.
When they are, I choose clarity.
-- Jacob Kaplan-Moss