Skip to content

Instantly share code, notes, and snippets.

@p-alik
p-alik / etc-nixos
Last active April 19, 2024 08:55
NixOS config on Dell XPS 13 Plus 9320
# /etc/nixos/configuration.nix
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
boot.loader.systemd-boot.enable = true;
@ClaytonHunt
ClaytonHunt / App.razor
Last active April 19, 2024 08:54
Dynamic Routing example in Blazor
<CascadingAuthenticationState>
<DynamicRouter AppAssembly="@typeof(Program).Assembly">
<Found>
<DynamicPage></DynamicPage>
</Found>
<NotFound>
Sorry no page
</NotFound>
</DynamicRouter>
</CascadingAuthenticationState>
@laytan
laytan / main.odin
Last active April 19, 2024 08:53
Raylib logging callback to Odin logger
logger: log.Logger
rl_log_buf: []byte
rl_log :: proc "c" (logLevel: rl.TraceLogLevel, text: cstring, args: libc.va_list) {
context = runtime.default_context()
context.logger = logger
level: log.Level
switch logLevel {
case .TRACE, .DEBUG: level = .Debug
case .ALL, .NONE, .INFO: level = .Info
@drubb
drubb / BackgroundBehavior.php
Last active April 19, 2024 08:52
Example for a paragraph behavior plugin
<?php
namespace Drupal\behaviors\Plugin\paragraphs\Behavior;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\paragraphs\Entity\Paragraph;
use Drupal\paragraphs\ParagraphInterface;
use Drupal\paragraphs\ParagraphsBehaviorBase;
@Williero
Williero / index.html
Created January 14, 2022 23:33 — forked from timothycarambat/index.html
Easy Web3 Meta Mask Login - static HTML and Vanilla JS
<html>
<head>
<title>Web3 Metamask Login</title>
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
</head>
<body class="flex w-screen h-screen justify-center items-center">
<div class="flex-col space-y-2 justify-center items-center">
<button id='loginButton' onclick="" class="mx-auto rounded-md p-2 bg-purple-500 text-white">

CadQuery Shape primitives


3d shapes

Box

Workplane.box

result = cq.Workplane("XY" ).box(3, 3, 3)

07

@ChrisMcKee
ChrisMcKee / PredicatableGuid.cs
Last active April 19, 2024 08:49
Namespaced Deterministic Guid - RFC 4122 dotnetcore
using System;
using System.Security.Cryptography;
using System.Text;
namespace Utility
{
/// <summary>
/// Helper methods for working with <see cref="Guid"/>.
/// </summary>
public static class GuidUtility
@cayter
cayter / repository.ts
Last active April 19, 2024 08:49
Drizzle ORM Type-Safe Repository With PgTable
import { startSpan } from "@sentry/remix";
import type { StartSpanOptions } from "@sentry/types";
import {
type AnyColumn,
type AnyTable,
type BuildQueryResult,
type DBQueryConfig,
type DrizzleTypeError,
type Equal,
type ExtractTablesWithRelations,
@pernalin9
pernalin9 / 微软输入法自动跳转为中文Fix.ahk
Last active April 19, 2024 08:47 — forked from maokwen/AutoHotKey-Switch-IME.ahk
微软输入法自动跳转为中文Fix.ahk
# 如果可以接受capslock作为输入法切换按键,强烈建议使用评论区脚本
# 如果可以接受capslock作为输入法切换按键,强烈建议使用评论区脚本
# 如果可以接受capslock作为输入法切换按键,强烈建议使用评论区脚本
#Include %A_ScriptDir%
timeInterval := 500
; +-------------------------+-------------------------+