Skip to content

Instantly share code, notes, and snippets.

@dj-nitehawk
dj-nitehawk / Program.cs
Last active June 11, 2025 21:02
API Visualization with Scalar
using FastEndpoints.Swagger;
using Scalar.AspNetCore; //dotnet add package Scalar.AspNetCore
var bld = WebApplication.CreateBuilder(args);
bld.Services
.AddFastEndpoints()
.SwaggerDocument(); //define a swagger doc - v1 by default
var app = bld.Build();
app.UseFastEndpoints(); //must come before the UseOpenApi() call
@davidmc971
davidmc971 / config.yml
Created January 30, 2022 14:45
My Trafik 2 Setup using Let's Encrypt Wildcard Certificates with Cloudflare
# config.yml in traefik directory
# Dynamic Configuration for Dashboard
http:
routers:
dashboard:
# Your domain here
rule: Host(`traefik-dashboard.example.com`)
service: api@internal
middlewares:
- auth
@kentcdodds
kentcdodds / session.server.ts
Created November 18, 2021 21:04
Authentication in Remix applications
import * as bcrypt from "bcrypt";
import { createCookieSessionStorage, redirect } from "remix";
import { db } from "./db.server";
export type LoginForm = {
username: string;
password: string;
};
@randyburden
randyburden / RoundRobinList.cs
Created November 12, 2021 03:43
C# Round Robin List that uses a simple, thread-safe, round-robin load balancing algorithm where it provides the next item in the list each time the Next method is called and starts back at the top of the list when it reaches the end of the list.
using System;
using System.Collections.Generic;
using System.Linq;
namespace Helpers
{
/// <summary>
/// Creates a round robin list that uses a simple, thread-safe, round-robin
/// load balancing algorithm where it provides the next item in the list each
/// time <see cref="Next"/> is called and starts back at the top of the list
@andrzejchm
andrzejchm / expandable_page_view.dart
Last active February 8, 2024 10:53
ExpandablePageView is a PageView that will adapt its height to the currently displayed child. with animation!
import 'package:flutter/material.dart';
class ExpandablePageView extends StatefulWidget {
final List<Widget> children;
const ExpandablePageView({
Key key,
@required this.children,
}) : super(key: key);
I was drawn to programming, science, technology and science fiction
ever since I was a little kid. I can't say it's because I wanted to
make the world a better place. Not really. I was simply drawn to it
because I was drawn to it. Writing programs was fun. Figuring out how
nature works was fascinating. Science fiction felt like a grand
adventure.
Then I started a software company and poured every ounce of energy
into it. It failed. That hurt, but that part is ok. I made a lot of
mistakes and learned from them. This experience made me much, much
@spemer
spemer / customize-scrollbar.css
Last active May 16, 2025 20:21
✨ Customize website's scrollbar like Mac OS. Not supports in Firefox and IE.
/* Customize website's scrollbar like Mac OS
Not supports in Firefox and IE */
/* total width */
body::-webkit-scrollbar {
background-color: #fff;
width: 16px;
}
/* background of the scrollbar except button or resizer */
@ibraheem4
ibraheem4 / postgres-brew.md
Last active September 27, 2025 02:49 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update