Skip to content

Instantly share code, notes, and snippets.

import bpy, random, math, time
from functools import partial
from collections import defaultdict
def create_circuit_pattern(w=30, h=160, trace_t=0.05, via_r=0.075, min_len=6, max_len=20, min_s=1, board_t=0.2, timeout=600,
chip_w=8, chip_h=8, chip_height=0.125, max_traces=None, density_factor=0.25, pin_spacing=1,
grid_spacing=0.25, color_transition_margin=0.4, emission_intensity=3.0, render_samples=128,
use_sector_based_filling=True, chip_emanating_trace_percentage=0.9, y_direction_bias=3.0):
# Initialize core variables and clear scene
start, count = time.time(), 0
// used to get device information for LLMs
#include <cuda_runtime.h>
#include <stdio.h>
int main() {
int deviceCount;
cudaGetDeviceCount(&deviceCount);
for(int dev = 0; dev < deviceCount; dev++) {
cudaDeviceProp prop;
-- Auto Commit Message
local M = {}
function M.generate_commit_message()
local api_key = os.getenv 'ANTHROPIC_API_KEY'
if not api_key then
vim.api.nvim_echo({ {
'ANTHROPIC_API_KEY environment variable is not set',
'ErrorMsg',
} }, true, {})
-- Helper function to get total line count of a file
local function get_file_line_count(file_path)
local file = io.open(file_path, 'r')
if not file then
return 0
end
local line_count = 0
for _ in file:lines() do
line_count = line_count + 1
end
# Writing Code and Documentation
## ⚠️ CRITICAL: ALL CODE MUST BE IN ARTIFACTS ⚠️
The single most important rule: NEVER write code directly in the conversation. ALL code MUST be provided as a unified diff file within an artifact. No exceptions.
## Before You Start
1. Read the user's request
2. Plan your response
3. Create a SINGLE unified diff file containing ALL code changes
4. Place this diff file in an artifact
@Mockapapella
Mockapapella / data_preparation.py
Last active January 12, 2025 13:36
3 Part Process for training a LoRA on an Obsidian Vault using Gemma 2B
import os
from pathlib import Path
from datasets import Dataset, load_from_disk
from transformers import AutoTokenizer
import warnings
import logging
import random
warnings.filterwarnings("ignore")
@Mockapapella
Mockapapella / example_assistant_response.md
Created November 16, 2023 16:14
An example of a query from a user

5.5 inch long Schedule 40 Type 304/304L Stainless Steel Threaded Pipe Nipples and Pipe:

  • Applicable for air, water, oil, natural gas, and steam.
  • Features full threading on both ends, known as close nipples.
  • Corrosion-resistant, economical alternative to 316/316L.
  • Welded construction with internal weld bead; sizes 1/8 - 3/8 inch are seamless.
  • Complies with ASTM A733, ASTM A312, ANSI/ASME B1.20.1 standards.
  • Connections: NPT.
  • Suitable for Class 150 low-pressure applications.
  • Recommended fittings: threaded flanges for low-pressure stainless steel.
#include <Adafruit_NeoPixel.h>
#define PON 6
#define PIN 7
#define PEN 8
/*
Analog Input
Demonstrates analog input by reading an analog sensor on analog pin 0 and
turning on and off a light emitting diode(LED) connected to digital pin 13.
The amount of time the LED will be on and off depends on
the value obtained by analogRead().
#include <Adafruit_NeoPixel.h>
#define PON 6
#define PIN 7
#define PEN 8
/*
Analog Input
Demonstrates analog input by reading an analog sensor on analog pin 0 and
turning on and off a light emitting diode(LED) connected to digital pin 13.
The amount of time the LED will be on and off depends on
the value obtained by analogRead().