This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rss from "@astrojs/rss" | |
import { getCollection } from "astro:content" | |
export async function get(context) { | |
const blog = await getCollection("blog") | |
return rss({ | |
title: "blackspike blog", | |
description: "thoughts from blackspike", | |
site: context.site, | |
stylesheet: "/rss-styles.xsl", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import formData from 'form-data' | |
import Mailgun from 'mailgun.js' | |
const DOMAIN = 'mg.example.com' | |
const USERNAME = 'api' | |
const mailgun = new Mailgun(formData) | |
const client = mailgun.client({ username: USERNAME, key: process.env.MAILGUN_API_KEY, url: 'https://api.eu.mailgun.net' }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Record | |
export async function record() { | |
// reset() | |
play() | |
$video = null | |
console.log('record called') | |
const canvas = document.getElementById('canvas') | |
const videoStream = canvas.captureStream(60) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// lol | |
console.groupCollapsed("%cGreetings, fellow nerds!", "color: orangered") | |
console.group("%cDesign", "color: orange") | |
console.log( | |
"%cFonts %cInter, Satoshi", | |
"font-weight: 700", | |
"font-weight: 400" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// uzumaki (mosquito coil type) | |
// draws an (approximate) archimedes' spiral | |
// test env: Adobe Illustrator CS3, CS6 (Windows) | |
// Copyright(c) 2009-2013 Hiroyuki Sato | |
// https://github.com/shspage | |
// This script is distributed under the MIT License. | |
// See the LICENSE file for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import MastodonCard from "./MastodonCard.astro" | |
const acct = | |
"https://mastodon.cloud/api/v1/accounts/109461933672061521/statuses" | |
const fetchPosts = await fetch(acct) | |
const allPosts = await fetchPosts.json() | |
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { isFooter } = Astro.props | |
const ElementH = "header" | |
const ElementF = "footer" | |
const ElementType = isFooter ? ElementF : ElementH | |
--- | |
<ElementType | |
class="header-footer" | |
class:list={menuOpen ? "nav-open" : ""} | |
data-footer={isFooter ? "true" : "false"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const TWO_WEEKS_IN_MS = 14 * 24 * 60 * 60 * 1000; // 14 days in milliseconds | |
const targetDate = new Date('2023-03-10T14:45:04Z'); | |
const currentDate = new Date(); | |
if (currentDate.getTime() - targetDate.getTime() >= TWO_WEEKS_IN_MS) { | |
console.log('The target date is two weeks or older than the current date.'); | |
return true; | |
} else { | |
console.log('The target date is less than two weeks older than the current date.'); | |
return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"workbench.startupEditor": "newUntitledFile", | |
"atomKeymap.promptV3Features": true, | |
"editor.multiCursorModifier": "ctrlCmd", | |
"editor.formatOnPaste": true, | |
"terminal.integrated.fontSize": 14, | |
"editor.fontFamily": "SF Mono, Fira Mono, Consolas, 'Courier New', monospace", | |
"editor.tabSize": 2, | |
"workbench.editor.enablePreview": false, | |
"editor.minimap.enabled": false, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.