Skip to content

Instantly share code, notes, and snippets.

View blackspike's full-sized avatar
😬

felix blackspike

😬
View GitHub Profile
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",
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' })
// Record
export async function record() {
// reset()
play()
$video = null
console.log('record called')
const canvas = document.getElementById('canvas')
const videoStream = canvas.captureStream(60)
<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"
)
@blackspike
blackspike / Archimedean Spiral.jsx
Created April 19, 2023 08:59
illustrator scripts
// 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.
---
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()
---
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"}
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;
{
"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.