Experiment for creating .drl
drill files.
These are used in the process of fabricating PCBs (printed circuit boards), they specify where the laser/mechanical drills should drill holes.
The format is also known as Excellon.
import { expect } from 'vitest' | |
expect.extend({ | |
async toError(promise, status, message=null) { | |
try { | |
await promise | |
return { pass: false, message: () => 'Expected an error to be raised.'} | |
} catch (actual) { | |
if (actual?.constructor?.name !== 'HttpError') { |
Experiment for creating .drl
drill files.
These are used in the process of fabricating PCBs (printed circuit boards), they specify where the laser/mechanical drills should drill holes.
The format is also known as Excellon.
<script> | |
import * as THREE from 'three' | |
import { SVGLoader } from 'three/examples/jsm/loaders/SVGLoader.js' | |
import { T, useThrelte } from '@threlte/core' | |
import { onMount } from 'svelte' | |
const { invalidate } = useThrelte() | |
const loader = new SVGLoader() | |
let wrapper |
{ | |
"src/routes/*page.svelte": { | |
"alternate": [ | |
"src/routes/{}page.js", | |
"src/routes/{}page.server.js" | |
], | |
"template": [ | |
"<script>", | |
" export let data", | |
"</script>" |
# Create a vanilla SvelteKit project | |
# usage: sk <folder-name> | |
sk() { | |
pnpm create svelte@latest $1 \ | |
&& cd $1 \ | |
&& pnpm install \ | |
&& git init \ | |
&& git add . \ | |
&& git commit -m 'Initial commit' | |
} |
snippet model "define a model" | |
model ${1:Name} { | |
id Int @id @default(autoincrement()) | |
${2} | |
createdAt DateTime @default(now()) | |
updatedAt DateTime @updatedAt | |
} | |
snippet enum "define an enum" |
/* | |
data can enter the pipeline via push or pull. | |
the result of each intermediate step is stored (so errors can be retried) | |
at the end of the pipeline data is put into a document store | |
optionally, event handlers can listen to create/update/delete events and fan data out to other systems | |
*/ | |
// example of a push handler (aka webhooks) | |
// src/push/shopify/order/created.js | |
// receive events, and returned data is stored in ClickHouse (OLAP) by the framework. |
/* activation functions */ | |
// linear activation (no-op) | |
function linear(value) { return value } | |
// threshold activation | |
function threshold(x = 0) { | |
return (value) => value >= x ? 1 : 0 | |
} |