Skip to content

Instantly share code, notes, and snippets.

View SebbeJohansson's full-sized avatar

Sebastian Johansson SebbeJohansson

View GitHub Profile

Ghostty Keyboard Shortcuts

Default keyboard shortcuts for Ghostty terminal emulator. Platform-specific differences are noted where applicable.

Window Management

Action Windows/Linux macOS
New window Ctrl+Shift+N Cmd+N
Close window Alt+F4 Cmd+Shift+W
@SebbeJohansson
SebbeJohansson / StoryblokLiveEditorWithManualFetch.vue
Created October 21, 2022 14:18
Storyblok doesnt allow for Live Editor update on edit when doing a manual fetch without their functions, so this is how I handle it.
<script setup lang="ts">
import { StoryData } from '@storyblok/vue/dist';
const route = useRoute();
const isPreview = !!(route.query._storyblok && route.query._storyblok !== '');
const version = isPreview ? 'draft' : 'published';
const story = ref({} as StoryData);
@edjdavid
edjdavid / file.md
Created October 13, 2022 12:45
Stream Windows webcam/desktop via RTSP

Can be used for streaming data (webcam or screen capture) from the Windows to WSL

Install

  1. Simple RTSP Server
  2. ffmpeg

Get the internal IP of WSL

Run from a WSL terminal

ip route list default | awk '{print $3}'
<?php
/**
* Get either a gravatar URL or a complete image tag for a specified email
*
* @param string $sEmail The email address
* @param string $sSize The size on pixels, defaults to 80px [ 1 - 2048 ]
* @param string $sDefault Default imageset to use [ 404 | mp | identicon | monsterid | wavatar ]
* @param string $sRating Maximum rating (inclusive) [ g | pg | r | x ]
* @param boolean $bImg True to return the complete img-tag, false for just the URL
@wojteklu
wojteklu / clean_code.md
Last active March 16, 2026 06:58
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@davidfowl
davidfowl / dotnetlayout.md
Last active March 18, 2026 16:12
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/