Skip to content

Instantly share code, notes, and snippets.

View SebbeJohansson's full-sized avatar

Sebastian Johansson SebbeJohansson

View GitHub Profile
@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);
<?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 January 15, 2025 07:41
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 January 11, 2025 04:57
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/