Skip to content

Instantly share code, notes, and snippets.

Avatar
🏳️‍🌈
happy pride month

Caleb Jasik jasikpark

🏳️‍🌈
happy pride month
View GitHub Profile
@jasikpark
jasikpark / Tab.tsx
Created April 25, 2023 18:53
Example of a polymorphic ariakit Tab component that can be a button or link
View Tab.tsx
import { Tab as AriakitTab, type TabProps } from 'ariakit/tab';
import cn from 'classnames';
import { useLayoutEffect, useRef } from 'react';
import { useRect } from '@hooks/useRect';
import { useAnimatedTabs } from '../context/useAnimatedTabs';
import styles from './Tab.module.css';
/**
* A tab that goes at the top of a tab panel, which a user clicks on to change the UI underneath.
* This is a button by default, but can also be a react-router Link, if the `to` and `as` props are provided.
@jasikpark
jasikpark / posts%slash%[slug].astro
Created March 24, 2023 18:35
Imagined example of an SSR endpoint that returns the markdown sent in the request rendered in an Astro page shell as html
View posts%slash%[slug].astro
---
import { Markdown } from 'astro-remote';
import MainLayout from "@layouts/MainLayout.astro";
const markdown = Astro.request.headers.get('markdown');
---
<html>
<MainLayout>
<h1>My ODB post page</h1
<!-- Disallow inline `style` attributes, but allow HTML comments -->
<Markdown content={markdown} sanitize={{ dropAttributes: { "style": ["*"] }, allowComments: true }} />
@jasikpark
jasikpark / bleck
Last active January 26, 2023 18:04
View bleck
openapi: 3.1.0
servers:
- url: https://api.defined.net
description: Default server
info:
description: |
# Introduction
This API is documented in **OpenAPI format** and describes methods that can be invoked when using an api key from <https://admin.defined.net/settings/api-keys>
Each endpoint is versioned individually, under a `/vXX` endpoint, ex `/v1/hosts` would become `/v2/hosts` with a breaking change, while `/v1/host-and-enrollment-code` would remain at `/v1`
@jasikpark
jasikpark / getBgHero.ts
Created December 14, 2022 19:31
Tool to generate a responsive `background-image: url("bg-hero.jpg");` for https://defined.net homepage
View getBgHero.ts
import { getPicture } from "@astrojs/image";
type BgHeroCSS = {
/** perfect for use w/ define:vars to inject */
cssProperty: string;
/** the source of the regular image */
imageSrc: string;
/** the sourceset used in the image-set */
imageSet: string;
/** the set useful for preloading
@jasikpark
jasikpark / _getAllPublishablePosts.ts
Created October 31, 2022 17:37
Helper function at `src/pages/blog/_getAllPublishablePosts.ts`
View _getAllPublishablePosts.ts
import { assert } from "assert-ts";
import type { MarkdownInstance, MDXInstance } from "astro";
import type { MarkdownFrontmatter } from "@data/posts/MarkdownFrontmatter";
export type MarkdownOrMDXInstance =
| MarkdownInstance<MarkdownFrontmatter>
| MDXInstance<MarkdownFrontmatter>;
type PartialMarkdownOrMDXInstance =
| MarkdownInstance<Partial<MarkdownFrontmatter>>
@jasikpark
jasikpark / [...slug].astro
Created October 31, 2022 16:57
Showing an attempt at a type-safe MD + MDX glob and sort for a blog
View [...slug].astro
---
import BlogIndex from "@layouts/BlogIndex.astro";
import BlogPost from "@layouts/BlogPost.astro";
import { assert } from "assert-ts";
import type { MarkdownInstance, MDXInstance, Page, PaginateFunction } from "astro";
import type { AstroComponentFactory } from "astro/dist/runtime/server";
import BlogMeta from "./meta.json";
import type { MarkdownFrontmatter } from "@data/posts/MarkdownFrontmatter";
type MarkdownOrMDXInstance =
@jasikpark
jasikpark / vtech-video-painter-bending.md
Created May 3, 2021 05:19
Looking for resources about circuit bending the Vtech Video Painter, there's not a lot of specific information.
View vtech-video-painter-bending.md

Vtech Video Painter Bending research....

Direct mention of Vtech Video Painter info

Not directly related, but possibly helpful

View gio-mime-type
display name: Screenshot 2019-04-28 16.33.08.png
edit name: Screenshot 2019-04-28 16.33.08.png
name: Screenshot 2019-04-28 16.33.08.png
type: regular
size: 207376
uri: file:///Users/calebjasik/Dropbox/Screenshots/Screenshot%202019-04-28%2016.33.08.png
attributes:
standard::type: 1
standard::name: Screenshot 2019-04-28 16.33.08.png
standard::display-name: Screenshot 2019-04-28 16.33.08.png
View building_fractal_on_macos.sh
Compiling pest_meta v2.1.0
Compiling rand_os v0.1.2
error: failed to run custom build command for `gettext-sys v0.19.8 (https://github.com/danigm/gettext-rs?branch=no-gettext#c514bbe5)`
process didn't exit successfully: `/Users/calebjasik/Desktop/Github/fractal/_build/target/release/build/gettext-sys-bdfa2747f4c72222/build-script-build` (exit code: 101)
--- stdout
cargo:rustc-link-lib=framework=CoreFoundation
cargo:rustc-link-lib=dylib=iconv
cargo:rerun-if-env-changed=X86_64_APPLE_DARWIN_GETTEXT_DIR
cargo:rerun-if-env-changed=GETTEXT_DIR
cargo:rerun-if-env-changed=X86_64_APPLE_DARWIN_GETTEXT_BIN_DIR
View hello.rs
struct User {
name: &'static str,
email: &'static str,
}
let caleb_jasik = User {
name: "Caleb Jasik",
email: concat!("calebjasik", "at", "jasik.xyz"),
};