Skip to content

Instantly share code, notes, and snippets.

@mickert
mickert / app.js
Created March 5, 2025 12:17
Directus 9.9, 10 and up running from app.js or index.js on IIS, IISNODE, PLESK, etc. (fix for Package subpath './server' is not defined by "exports", DeprecationWarning: Buffer()) and ERR_SOCKET_BAD_PORT
// Fixes for Directus 9.9, 10 and up issues:
// Directus - An instant no-code App and dynamic API for any SQL database - https://github.com/directus
//
// Package subpath './server' is not defined by "exports" - Export issue after v9.22.3 #18700
// https://github.com/directus/directus/issues/18700
// Deploy error when using Passenger Server (Plesk) with Directus 9.0.0 #9613
// https://github.com/directus/directus/issues/9613
//
// Rerolled fix by github user stylefieber - https://github.com/stylefieber in issue #18307
// to make it easier to find and deploy. Filtered deprecation warnings (for iisnode).
@xem
xem / readme.md
Last active March 5, 2025 12:17
Maths & trigonometry cheat sheet for 2D & 3D games

Conventions

  • A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
  • lengths are in any unit (ex: pixels)
  • code snippets are in JavaScript

Degrees to radians

angleRad = angleDeg * Math.PI / 180;

void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
await NotificationService.instance.initialize();
//YOUR OTHER CODE CAN COME IN HERE
runApp(const MyApp());
@padeoe
padeoe / enhanced-nvidia-smi.md
Last active March 5, 2025 12:08
Show Username & full process command with nvidia-smi

For typical use cases, I prefer using nvitop to view detailed information. This script offers a dependency-free implementation.

The script enhances the functionality of nvidia-smi and provides the following info:

  • Username
  • full process Command
  • GPU ID
  • PID

This is useful on multi-user servers and can be used to quickly identify which user is using the GPU and running what kind of program.

@yasirkula
yasirkula / UnitypackageExtractor.cs
Last active March 5, 2025 12:07
Extract a .unitypackage to any directory (even outside the project folder) from within Unity
#define STOP_EXTRACTION_WHEN_WINDOW_CLOSED
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Reflection;
using System.Text;
using System.Threading;
using UnityEditor;
@tarruda
tarruda / micro_events.py
Last active March 5, 2025 12:05
Micro event loop library to teach the basic concepts of python coroutines and how event loop libraries might be implemented
"""
A micro event loop library implementation from scratch.
This library provides a minimal but feature-complete asynchronous event loop
implementation for educational purposes. It demonstrates the core concepts of
asynchronous programming including:
- Task scheduling and management
- I/O multiplexing with non-blocking sockets
- Timeouts and sleep functionality
@VictorTaelin
VictorTaelin / claude_code_hvm_work.txt
Created March 5, 2025 02:18
Claude Code optimizes HVM3-Nano from 183 MIPS to 265 MIPS on Apple M3 // 217 MIPS to 328 MIPS on Apple M4
╭────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code research preview! │
│ │
│ /help for help │
│ │
│ cwd: /Users/v/vic/dev/IC │
╰────────────────────────────────────────────╯
! cat InteractionCalculus.md
@katiakweb
katiakweb / office-activation.md
Created February 21, 2024 17:55 — forked from devomman/activate-office-windows-mac.md
Office Activation Command by Omman

Office 2021

Method 1: Using my command line

Step 1.1: Open cmd program with administrator rights.

  • First, you need to open cmd in the admin mode, then run all commands below one by one.

Step 1.2: Get into the Office directory in cmd.

  • For x86 and x64
cd /d %ProgramFiles(x86)%\Microsoft Office\Office16
cd /d %ProgramFiles%\Microsoft Office\Office16
@hellokaton
hellokaton / card.html
Last active March 5, 2025 12:01
卡片生成提示词+网页
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>笔记卡片生成器</title>
<!-- Tailwind CSS CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- HTML2Canvas 导出功能 -->
<script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>