Skip to content

Instantly share code, notes, and snippets.

@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
; +-------------------------+-------------------------+
@stephancasas
stephancasas / NSApplication+NSResponderDebug.swift
Created March 18, 2024 20:35
An extension on NSApplication providing a computed property that describes the current responder chain.
//
// NSApplication+NSResponderDebug.swift
//
// Created by Stephan Casas on 3/18/24.
//
import Cocoa;
extension NSApplication {
@renatus-cartesius
renatus-cartesius / .dsl
Created April 1, 2022 21:44
untitled: a trio from https://penrose.ink
type Set
@cxyxlxdm
cxyxlxdm / GridSpacingItemDecoration.md
Last active April 19, 2024 08:43
Add column spacing in RecyclerView with GridLayoutManager

Android Recyclerview GridLayoutManager column spacing Here is the question, the first answer does not work well in my project,and it makes the spacing bigger between item and item. the second answer is quite perfect.But if RecyclerView has headers,it does not work well. Then I fixed it.

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**