Skip to content

Instantly share code, notes, and snippets.

View reggi's full-sized avatar
🌺
Learning

Reggi reggi

🌺
Learning
View GitHub Profile
@reggi
reggi / virtual.md
Created October 17, 2025 05:28
Idea

I've had an idea for a bit that i've parked on and I just wanted to document it because I told someone today at a tech meetup about it, but I also spoke to some other people about it over the year.

The main idea is a static site generate / server side site generator.

It points to a directory of files and builds that list of files into a website.

Each directory is a webpage and there can be different views to how that webpage is viewed.

For instance you can have a directory show as "two column" / "wiki style" is where you have a list of files on the right and you click the page and the right is the content.

Build the image

docker build -t watchy-dev .

Run the container and mount CWD

docker run --rm -it
--device=/dev/ttyACM0
--privileged
-v "$(pwd)":/home/dockeruser/app
watchy-dev

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
import { Plugin } from "$fresh/server.ts";
const sources = [
"https://raw.githubusercontent.com/bigskysoftware/htmx/dev/src/htmx.js",
"https://raw.githubusercontent.com/bigskysoftware/htmx/dev/src/ext/head-support.js"
]
export default function htmx(): Plugin {
const main = `data:application/javascript,${sources.map(s => `import "${s}";`).join('')} export default () => {}`
return {
@reggi
reggi / glob-up-and-running.md
Last active November 26, 2024 05:58
A tutorial on how to get started using glob patterns in your terminal. #writing

Glob Up and Running

To test a glob pattern go over to globtester and play around with creating your own file structure online, it's super easy to get started that way.

If you want to test out a glob pattern in the terminal use echo followed by the pattern, for instance.

echo **/*.js
@reggi
reggi / anime.yml
Last active September 22, 2024 17:12
-
name: Delicious in Dungeon
date: August 2024
rating: 10/10
thoughts: "Really cozy vibes, love the world building and the characters. The art is also really good."
-
name: "Frieren: Beyond Journey's End"
date: September 2024
rating: 10/10
thoughts: "I view this as a retrospect on life and our life-spans, regret, death and the friends you make along the way."
#!/bin/bash
# Get the list of dependencies from package.json
DEPENDENCIES=$(jq -r '.dependencies | keys[]' package.json)
# Loop through each dependency
for DEP in $DEPENDENCIES; do
# Get the path to the dependency's package.json
DEP_PACKAGE_JSON="node_modules/$DEP/package.json"
import { JSX, ComponentChild, VNode } from "https://esm.sh/v96/preact@10.11.2"
import render from 'preact-render-to-string'
// you need a way to ignore the type error for an async component
const asyncComponent = (component: (props: any) => Promise<JSX.Element>): (props: any) => JSX.Element => {
return component as any
}
const Alice = asyncComponent(async (props: { children: ComponentChild}) => {
const x = await Promise.resolve('Alice')
AES-128-CBC
AES-128-CFB
AES-128-CFB1
AES-128-CFB8
AES-128-CTR
AES-128-ECB
AES-128-OFB
AES-128-XTS
AES-192-CBC
AES-192-CFB
@reggi
reggi / socket-io-emit-async.js
Last active June 4, 2024 08:46
Socket.io emit async
var io = require('socket.io-client')("http://localhost:3001")
var Promise = require("bluebird")
io.emitAsync = Promise.promisify(io.emit)
io.emitAsync("report", {
"name": "thomas"
}).then(function(data){
console.log(data)
}).catch(function(e){
console.log(e.message)