Skip to content

Instantly share code, notes, and snippets.

View greystate's full-sized avatar
:octocat:
Octocatering

Chriztian Steinmeier greystate

:octocat:
Octocatering
View GitHub Profile
@AaronSadlerUK
AaronSadlerUK / query.sql
Created February 4, 2026 19:29
Find Umbraco Macro usage
-- Find PUBLISHED content with macros in Umbraco 13
SELECT DISTINCT
n.text AS 'Content Name',
n.id AS 'Node ID',
pt.Alias AS 'Property Alias',
SUBSTRING(pd.textValue, 1, 500) AS 'Preview'
FROM umbracoPropertyData pd
INNER JOIN umbracoContentVersion cv ON pd.versionId = cv.id
INNER JOIN umbracoDocumentVersion dv ON cv.id = dv.id AND dv.published = 1
INNER JOIN umbracoNode n ON cv.nodeId = n.id
#!/bin/sh
# dfn: df normalized, or df not noisy, or df nicely, or df new
#
# Whatever you want to call it, this script makes df useful again.
# It removes read-only disks for Time Machine backups, system volumes
# that can't be modified, unbrowsable volumes, and other stuff you don't
# really care about.
#
# Instead, you get the same drives that you see on your Mac desktop in an
@Rockerby
Rockerby / ConditionalRedirectWorkflow.cs
Last active May 23, 2025 11:02
A sample workflow for Umbraco forms that allows the editor to select a custom redirect URL. Great to combine with workflow conditions to give dynamic redirects based on form fields. Created for Umbraco v13, not tested in later versions.
using Umbraco.Forms.Core;
using Umbraco.Forms.Core.Enums;
using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Http;
using Umbraco.Forms.Core.Attributes;
using Umbraco.Cms.Core;
using Umbraco.Extensions;
using Microsoft.Extensions.DependencyInjection;
namespace Example.Forms.Workflows
@sophiateutschler
sophiateutschler / SmoothShadowModifier.swift
Created October 13, 2024 19:44
A SwiftUI view modifier to generate layered/smooth shadows
//
// MIT License
//
// Copyright (c) 2024 Sophiestication Software, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
//
// ColorSchemeApp.swift
// ColorScheme
//
// Created by Craig Hockenberry on 9/11/24.
//
import SwiftUI
@main
@chockenberry
chockenberry / finder_icons.sh
Created March 16, 2023 20:00
Script to toggle Finder icons
#!/bin/sh
defaults read com.apple.finder CreateDesktop > /dev/null 2>&1
enabled=$?
if [ "$1" = "off" ]; then
if [ $enabled -eq 1 ]; then
osascript -e 'tell application "Finder" to quit'
defaults write com.apple.finder CreateDesktop false
open -a Finder
@chockenberry
chockenberry / AttributedString.swift
Created June 1, 2022 21:08
A playground that shows how to use Swift's AttributedString with Markdown
import UIKit
import Foundation
// NOTE: This playground shows how to use Swift's AttributedString with Markdown.
//
// This code was used to display Markdown content in the Tot iOS Widget <https://tot.rocks>
// MARK: - Helpful Links
// NOTE: The following links helped me figure this stuff out.
@monkeydom
monkeydom / ks_changeset.sh
Created May 3, 2022 08:13
Script to put 2 folders into a single changeset git and diff it using ksdiff to see the changeset nicely
#!/bin/sh
# ks_changeset v0.9 - 2022-05-03
# Enable "safe" mode - see http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
if [[ $# -lt 3 ]]; then
echo "Usage: ks_changeset.sh <FolderA> <FolderB> <DestinationGit>"
public class MovieSerivce : IMovieService
{
private readonly IAppPolicyCache _runtimeCache;
private const string MOVIES_CACHE_KEY = "Movies.API.Cache";
public MovieSerivce(AppCaches appCaches)
{
_runtimeCache = appCaches.RuntimeCache;
}
@huytd
huytd / wordle.md
Last active November 21, 2025 07:17
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode: