Skip to content

Instantly share code, notes, and snippets.

View martymcguire's full-sized avatar

Marty McGuire martymcguire

View GitHub Profile
1 REM ARTLUNG START
3 CALL CLEAR
5 CALL CHAR(33, "000000FFFFFFFFFF")
7 CALL VCHAR(11, 1, 33)
11 CALL VCHAR(11, 2, 33)
15 CALL VCHAR(11, 3, 33)
19 CALL VCHAR(11, 4, 33)
23 CALL VCHAR(11, 5, 33)
27 CALL VCHAR(11, 6, 33)
31 CALL VCHAR(11, 7, 33)
accordion-group {
background-color: #f7f7f7;
border-radius: 0.25em;
display: block;
margin-block-end: 1.5em;
padding: 0.5em 1em;
width: 100%;
}
accordion-group [accordion-trigger] {
@adactio
adactio / geocode.php
Created December 16, 2024 15:04
A PHP script that uses a third-party provider to get latitude, longitude, and zoom level (for use in embedded maps).
<?php
/*
Pass in a string: geocode("The Jolly Brewer, Brighton, East Sussex England")
The output is an array with keys for "latitude", "longitude", and "zoom".
*/
function geocode($location, $provider = "mapquest") {
$return = array();
const calculator = (function () {
/**
* Add two or more numbers together
* @param {...Numbers} nums The numbers to add together
* @return Number The total
*/
function add (...nums) {
let total = nums.length ? nums.shift() : 0;
for (let num of nums) {
@emilyliu7321
emilyliu7321 / bluesky-comments.tsx
Created November 25, 2024 05:39
Integrate Bluesky replies as your blog's comment section
"use client";
/* eslint-disable @next/next/no-img-element */
import Link from "next/link";
import { useState, useEffect } from 'react';
import {
AppBskyFeedDefs,
AppBskyFeedPost,
type AppBskyFeedGetPostThread,
} from "@atproto/api";
<?php
/*
Pass in an array of data that includes the text of the post and an access token e.g.
postToBluesky(array(
'text' => 'Hello World',
'accessToken' => getBlueskyToken()
));
Here's the gist for getting getBlueskyToken():
https://gist.github.com/adactio/1a850920a0554a49f36daf79d776a440
@cferdinandi
cferdinandi / README.md
Created October 7, 2024 17:39
A PHP endpoint for posting to Bluesky

Bluesky PHP endpoint

A PHP endpoint for posting to the Bluesky API.

On Bluesky...

  1. Click Settings.
  2. Click App Passwords.
  3. Click the Add App Password button.
  4. Give it a name, then click Create App Password.
@Fantailed
Fantailed / supernote_template_tips.md
Last active August 29, 2025 18:01
Supernote A6X2 Nomad Template Mockup + Template Creation Workflow Tips

Supernote A6X2 Nomad Template Mockup + Template Creation Workflow Tips

Downloads

Mockup

Affinity: Download .aftemplate
Photoshop (PSD export; compatibility not guaranteed): Download .psd

@rosemulazada
rosemulazada / script.js
Last active December 3, 2024 16:18
SCALABLE: Save form data to localStorage and auto-complete on refresh
// With the help of Jeremy Keith, I was able to create a fully scalable code sample that you can copy-paste into your project.
// It will save the user input value on blur, this includes radio buttons, checkboxes and date inputs besides regular text/number inputs.
// The only condition is that you give the form element on your page a data-attribute of data-form-topic="foo".
// This code snippet saves the data-attribute as the key to the localStorage, and the value of it will be an object with key/value pairs of the respective inputs name and value.
// Please refer to this gist somewhere in your code if you use it :)
// Happy coding!
// VARIABLE DECLARATIONS
// objects
let savedData = {};
@OrionReed
OrionReed / dom3d.js
Last active December 9, 2025 17:22
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯