Skip to content

Instantly share code, notes, and snippets.

Derpi Show

vgy.me

Usage

hotkey action
A or 🠈 previous image
D or 🠊 next image
@Atulin
Atulin / README.md
Last active July 20, 2025 19:52
SolidElement Styled wrapper

Styled wrapper for SolidElement webcomponents

1. Create a regular ol' Solid component:

const Counter: ComponentType<{ title: string, count: number }> = (props) => {
	const [count, setCount] = createSignal(props.count);
	
	return (
 
// the database entity
public sealed class Person
{
public int Id { get; set; }
public string Name { get; set; }
public DateOnly Birthday { get; set; }
public int ShoeSize { get; set; }
public string Password { get; set; }
public string Email { get; set; }
}
{
"name": "Writing",
"icon": "book",
"extensions": "[{\"identifier\":{\"id\":\"akhail.save-typing\",\"uuid\":\"658b5664-4b80-4bba-9fb9-6e212e6d223d\"},\"displayName\":\"Save Typing\",\"disabled\":true,\"applicationScoped\":false},{\"identifier\":{\"id\":\"alefragnani.project-manager\",\"uuid\":\"1b747f06-3789-4ebd-ac99-f1fe430c3347\"},\"displayName\":\"Project Manager\",\"applicationScoped\":false},{\"identifier\":{\"id\":\"andyhuzhill.typewriterscrollmode\",\"uuid\":\"4ef68ff4-831f-41da-856d-d6f6ac5549da\"},\"displayName\":\"Typewriter Scroll Mode\",\"applicationScoped\":false},{\"identifier\":{\"id\":\"bierner.markdown-footnotes\",\"uuid\":\"8c379296-feca-4544-853d-f085a1fc638f\"},\"displayName\":\"Markdown Footnotes\",\"applicationScoped\":false},{\"identifier\":{\"id\":\"bierner.markdown-mermaid\",\"uuid\":\"f8d0ffc4-66bb-4a9c-8149-ef8f043691a1\"},\"displayName\":\"Markdown Preview Mermaid Support\",\"applicationScoped\":false},{\"identifier\":{\"id\":\"davidanson.vscode-markdownlint\",\"uuid\
@Atulin
Atulin / list-licenses.ts
Created May 21, 2025 00:33
Get .NET project nuggie data
import { dirname, join } from "node:path";
import { Glob } from "bun";
import { ReturningHtmlRewriter } from "./helpers/ReturningHtmlRewriter";
const ROOT = dirname(Bun.main);
const OUTFILE = join(ROOT, "..", "..", "wwwroot", "LICENSES.txt");
const PROJECT_ROOT = join(ROOT, "..", "..", "..");
interface Source {
name: string;
@Atulin
Atulin / 1_Decent.cs
Last active March 30, 2025 19:21
ASP.NET Core responses
[HttpGet("things/{id:int}")]
public async Task<IActionResult> GetThing(int id)
{
var thing = await _context.Things
.Where(t => t.Id == id)
.Select(t => new ThingDto {
Name = t.Name,
Count = t.Count,
Score = t.Upvotes - t.Downvotes,
})
@Atulin
Atulin / Async.razor
Last active March 26, 2025 20:38
Async component
@typeparam TItem
<div>
@((TaskStatus, item: _item) switch {
(Status.Loading, null) => LoadingTemplate,
(Status.Done, not null) => ItemTemplate.Invoke(_item),
(_, _) => ErrorTemplate.Invoke(_error),
})
</div>
@Atulin
Atulin / DateExperiments.ts
Created March 18, 2025 16:37
Experimenting with low weight code to manipulate Javascript dates
type Props = "FullYear"| "Month"| "Date"| "Hours"| "Minutes"| "Seconds"| "Milliseconds";
type Getter = `get${Props}`;
type Setter = `set${Props}`;
type DeltaDate = Partial<Record<Lowercase<Props>, number | undefined>>;
const getProp = (obj: DeltaDate, prop: Props) => obj[prop.toLowerCase() as Lowercase<Props>] ?? 0
export const mutateDate = (date: Date, delta: DeltaDate) => {
for (const p of Object.keys(delta) as Props[]) {
@Atulin
Atulin / proposal.md
Created August 16, 2024 21:29
C# contracts
// any method with a `constrain` needs to return a `Result`
public Result<string> Foo(int num, string text) constrain {
    num is > 0 and < 100,
    text is { Length: < 200 } and ['A', ..]
} {
    return $"Text is '{text}' and number is {num}";
}

var text = Foo() switch {
@Atulin
Atulin / README.md
Last active September 10, 2024 22:25
Tierlist Stars schemas