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
#!/bin/bash | |
for file in "$@"; do | |
# Extract filename with extension | |
filename=$(basename "$file") | |
# Print Markdown header with filename (including extension) | |
echo "## $filename" | |
echo '```' | |
cat "$file" | |
echo '```' |
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 canvasSketch = require("canvas-sketch"); | |
// Grab P5.js from npm | |
const p5 = require("p5"); | |
// Attach p5.js it to global scope | |
new p5(); | |
const settings = { | |
p5: true, |
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 ddf.minim.*; | |
Minim minim; | |
AudioInput mic; | |
int rows = 128; | |
int cols = 64; | |
float scale = 4.5; // Scale factor for the size of the circles | |
float noiseScale = 0.012; // Scale factor for the Perlin noise | |
float micThreshold = -10; | |
float t = 0; // Noise offset |
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
<template> | |
<TresGroup :position="offsetPosition"> | |
<!-- Line from this orbital object to the center --> | |
<TresMesh> | |
<Line2 :points="[[0, 0, 0], [-offsetPosition[0], -offsetPosition[1], -offsetPosition[2]]]" :line-width="2" color="#82dbc5" /> | |
<TresLineBasicMaterial :color="'#ffffff'" /> | |
</TresMesh> | |
<!-- Orbital Object Sphere --> | |
<TresMesh> |
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 setup> | |
import { ref } from 'vue'; | |
import { useElementBounding, useWindowSize } from '@vueuse/core'; | |
import { useTres } from 'tresjs'; | |
// `domElementRef` is a ref for the DOM element we want to map to the 3D scene | |
const domElementRef = ref(null); | |
// Use VueUse's useElementBounding to track the element's position and size | |
const { left, top, width, height } = useElementBounding(domElementRef); |
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 setup> | |
import { ref } from 'vue' | |
import { useTween } from '@vueuse/core' | |
// Let's assume each circle has an initial x and y position | |
const circles = ref([ | |
{ id: 1, x: 100, y: 100 }, | |
{ id: 2, x: 150, y: 200 }, | |
// Add as many circles as you want | |
]) |
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
#!/bin/bash | |
# API keys for Cloudinary | |
export CLOUDINARY_URL=cloudinary://APIKEY@NAME | |
# Iterate over each passed argument | |
for file in "$@" | |
do | |
# Check if the file exists | |
if [ -f "$file" ]; then |
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
#!/bin/bash | |
# Create the directory if it doesn't exist | |
mkdir -p ~/screenshots | |
# Set the default location for screenshots | |
defaults write com.apple.screencapture location ~/screenshots | |
# Apply the changes by restarting the SystemUIServer | |
killall SystemUIServer |
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
# Defining all melodies with their durations in a dictionary-like structure | |
melodies = { | |
silent_night: { | |
notes: [:G, :A, :G, :E, :G, :A, :G, :E, :C, :G, :C, :G, :A, :A, :G], | |
durations: [0.5, 0.5, 1, 1, 0.5, 0.5, 1, 1, 0.5, 0.5, 1, 1, 0.5, 0.5, 1] | |
}, | |
jingle_bells: { | |
notes: [:E, :E, :E, :E, :E, :E, :E, :G, :C, :D, :E, :F, :F, :F, :F, :F, :E, :E, :E, :E, :E, :D, :D, :E, :D, :G], | |
durations: [0.5, 0.5, 1, 0.5, 0.5, 1, 0.5, 0.5, 0.5, 1, 1, 0.5, 0.5, 0.5, 0.5, 1, 0.5, 0.5, 0.5, 0.5, 1, 0.5, 0.5, 0.5, 0.5, 1] | |
}, |
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 puppeteer = require('puppeteer'); | |
const fs = require('fs'); | |
(async () => { | |
try { | |
// Read the CSV file | |
const inputCsv = fs.readFileSync('output.csv', 'utf-8'); | |
const records = inputCsv.split('\n').map((row, index) => { | |
if (index === 0) return null; // Skip the header row | |
const [Index, Title, URL] = row.split(','); |