Skip to content

Instantly share code, notes, and snippets.

View svallory's full-sized avatar
:bowtie:
Coding like there's no tomorrow

Saulo Vallory svallory

:bowtie:
Coding like there's no tomorrow
View GitHub Profile
@svallory
svallory / nvims.bash.md
Last active August 24, 2024 02:22
Executable Markdown - Fusing Code and Docs

nvims

Important

This is an executable Markdown file, an experiment of merging documentation and code together. A tool for running the code is under development. The focus of this document is to figure a syntax that does not get in the way of the code.

Neovim Flavours Manager

Original version from elijahmanor's gist

@svallory
svallory / git-aliases.zsh
Last active June 24, 2024 17:56
Supercharged Git and Github Aliases for ZSH
#!/bin/zsh
###########################################################
# Get URLs for the current branch or the main branch
# Adding a path after the command will show the URL of that file on the current branch and the main branch
#
# NOTE: this DOES NOT CHECK if the file exists on github
#----------------------------------------------------------
# Examples:
# ```bash
@svallory
svallory / nice-logs.nu
Created June 14, 2024 04:38
Nicely format Docker logs
#!/usr/bin/env nu
# Tail the last 50 lines of docker-compose logs and follow
cat log.txt | lines
| each { sed 's/^[^|]*| //' }
| where { |line| $line =~ "^\{" }
| each { from json }
| each { |record|
let t = $record.t."$date"
let s = $record.s
@svallory
svallory / nice-logs.nu
Created June 14, 2024 02:11
Nicely format Docker logs
#!/usr/bin/env nu
# Tail the last 50 lines of docker-compose logs and follow
cat log.txt | lines
| each { sed 's/^[^|]*| //' }
| where { |line| $line =~ "^\{" }
| each { from json }
| each { |record|
let t = $record.t."$date"
let s = $record.s
@svallory
svallory / write-file.md
Created June 5, 2024 05:54
File Management Skill for GPT Remote

name: WriteFile version: 1.0.0 description: A plugin to write content to a file original_url: https://example.com/plugin/writeFile.md endpoints:

  • path: /write-file method: POST handler: writeFileHandler
@svallory
svallory / cli-utils.ts
Last active April 14, 2024 05:28
My utilities
import { expandToChalkString } from './template-strings.ts';
const exit = (error: string, code: number = -1) => {
console.info(eval(`expandToChalkString\`${error}\``));
process.exit(code);
}
import type { ForegroundColorName } from 'chalk';
const info = (msg: string, color: ForegroundColorName = 'yellow') => {
@svallory
svallory / .gitignore
Created March 25, 2024 01:57
Node .gitignore
.DS_Store
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
@svallory
svallory / marko-json.d.ts
Last active February 26, 2024 04:03
Types for marko.json and marko-tag.json
/**
* Represents a Marko tag name enclosed in angle brackets.
* Used to define custom Marko tags within a taglib definition.
*/
type TagShorthand = `<${string}>`;
/**
* Represents a shorthand for defining repeated tag within a Marko tag.
*/
type RepeatedTag = `${TagShorthand}[]`;
@svallory
svallory / elephant.html
Last active February 24, 2024 05:00
portal > htmz > htmx (LOL just kidding)
<h2>Elephant</h2>
<p>
Elephants are the largest existing land animals. Three species are currently
recognized: the African bush elephant, the African forest elephant, and the
Asian elephant.
</p>
@svallory
svallory / id_rsa.pub
Created February 4, 2024 16:17
my-pub-key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+IUXKEwgSAjypvuuedx8DqpIQrNtHcLWBFEnc24vWV1BApwDa57+bxAOKNTwk/QTOsmjDjyiiHNx532IW4Yg0+U/S0uFvHIlmpuFRst2rPloMktIPy2gOMXOqRhy8uwheGMP7FhXPZaivTYFJreLu1981ipMl5irhdo++FOU5G2DnSBIN1vqS1fR2zAEy1Nnc1Nabx0W5IoaIdAZJ5Z+I49XXq09pismxa6Mkx9otL6ijU7Jf7cH5RRoGj6BJQk/XuNdWpOCw1hWDOT3n5Gn6BGcdx0AoGD4DzqbNjXR1r9Wmjx26YEgNMC0iZRspKUUJMwhNa3TlA4u9N8RrAR0D [email protected]