Skip to content

Instantly share code, notes, and snippets.

View marshyon's full-sized avatar

jon brookes marshyon

View GitHub Profile
@marshyon
marshyon / justfile
Created June 7, 2025 12:55
basic justfile
BINGBING := "https://www.bing.com"
set dotenv-load
help:
echo "Bing URL is: {{BINGBING}}"
@echo "bongo is $BONGO"
just -l
@marshyon
marshyon / fuzzy_string_search.dart
Last active October 2, 2023 17:21
fuzzy string search of list of objects in dart using fuzzywuzzy
import 'package:fuzzywuzzy/fuzzywuzzy.dart';
class Book {
final String title;
final String author;
final String genre;
final String summary;
Book(this.title, this.author, this.genre, this.summary);
}
@marshyon
marshyon / gitea-backup.sh
Created September 5, 2023 09:41 — forked from bst27/gitea-backup.sh
A Gitea backup script for Docker: It creates a .zip backup of Gitea running inside Docker and moves the backup file to the current working directory.
#!/bin/bash
# This script creates a .zip backup of gitea running inside docker and copies the backup file to the current working directory
echo "Creating gitea backup inside docker containter ..."
docker exec -u git -it -w /tmp $(docker ps -qf "name=gitea_server_1") bash -c '/app/gitea/gitea dump -c /data/gitea/conf/app.ini --file /tmp/gitea-dump.zip'
echo "Copying backup file from the container to the host machine ..."
docker cp $(docker ps -qf "name=gitea_server_1"):/tmp/gitea-dump.zip /tmp
@marshyon
marshyon / animejs-staggered-grid-effect.markdown
Created February 20, 2023 13:18
AnimeJS Staggered Grid Effect
@marshyon
marshyon / hacked-text-effect.markdown
Created February 20, 2023 12:42
Hacked Text Effect
@marshyon
marshyon / app.js
Created February 4, 2023 20:35
parsing markdown with html tables that have 'spanning rows' - otherwise not possible with plain markdown
const tableMarkdown = `
# Table
<table>
<tr>
<td>One</td>
<td>Two</td>
</tr>
<tr>
@marshyon
marshyon / app.js
Created February 4, 2023 16:47
simple nodejs app that parses markdown, extracts the front-matter for later use then extracts, parses and outputs html for the main body, itself containing 'escaped' html in code blocks
mdHTMLMix = `---
id: q.yada yada.e
title: Network Designs Quiz
desc: ''
updated: 1668088687103
created: 1667513672394
---
# Network Designs Quiz
<figure>
@marshyon
marshyon / app.js
Last active February 4, 2023 16:32
simple node js app that can read in html, parse it and substitute known elements with new ones using cheero / JQuery of the days of yore
const cheerio = require('cheerio')
const htmlContent = `
<div class="rounded-sm shadow-xl p-10 shadow-md text-center bg-slate-100 text-primary box">
<div class="text-3xl pb-7 font-serif">CONTACT</div>
<div class="pb-5 prose-xl">How to contact me</div>
<article class="md:prose-lg prose-sm break-words">
<p>We&#x27;ll arrange a short telephone conversation and then work out the best options for you.</p>
<p>Please email me</p>
<p><a href="mailto:[email protected]">[email protected]</a></p>
<p>I am a qualified NLP Coach and Practitioner. I use strategies that bring about real change - techniques called &quot;Creating your future&quot; or Time Line TherapyTM.</p>
@marshyon
marshyon / main.go
Created January 24, 2023 21:14
Golang run and wait for many go routines using channels and returning a struct of result data for each process
package main
import (
"fmt"
"log"
"math/rand"
"time"
)
type SystemCommandResult struct {
@marshyon
marshyon / react-native-tab-stack-nav.js
Created January 13, 2023 13:11
react native tab and stack ( combined ) navigation
import 'react-native-gesture-handler';
import { StyleSheet, Text, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
const Tab = createBottomTabNavigator();
const Stack = createStackNavigator()
function StackNavHome() {