Skip to content

Instantly share code, notes, and snippets.

View axcellence's full-sized avatar

Axl axcellence

View GitHub Profile
@axcellence
axcellence / our details.js
Last active April 24, 2023 09:07
Woosmap MultiSearch API implementation comparison
// Brew Details call
const getSearchDetails = async suggestion => {
const details = await autocompleteService.detailsMulti({
id: suggestion.id,
api: suggestion.api,
})
return details
}
@axcellence
axcellence / sanity-to-markdown.md
Last active April 4, 2023 09:40
Asking ChatGPT (GPT-4): How would I export my data from Sanity.io into markdown files?

To export your data from Sanity.io into markdown files, you'll need to create a script that fetches the data from Sanity and then converts it into the desired markdown format. You can use Node.js for this task. The following steps outline the process:

Install required dependencies: First, make sure you have Node.js installed on your computer. Then, create a new folder for your project and initialize it with npm:

mkdir sanity-export
cd sanity-export
npm init -y
const Dump = ({ data }) => {
if (!data) return null;
return (
<pre className="bg-gray-100 text-sm p-4">
<code>{JSON.stringify(data, null, 4)}</code>
</pre>
);
};
export default Dump;
@axcellence
axcellence / auth.json
Last active October 5, 2021 16:25
WP Migrate DB Pro composer
{
"http-basic": {
"composer.deliciousbrains.com": {
"username": USERNAME,
"password": PASSWORD
}
}
}
@axcellence
axcellence / remote-media-loader.php
Last active June 21, 2021 08:59
Drop these in mu-plugins
<?php
/**
* Plugin name: Remote Media Loader
* Description: Save local storage space by mapping you /uploads directory to your staging or production site
* Author: Axl Crawford
* Author uri: https://www.barques.co.uk/
* License: MIT
*/
body { background: #081121; color: #e6e6e6; }
a { color: #949494; }
a:link, a:visited { color: #949494; }
a:hover, a:active, a:focus { color: #c7c7c7; }
hr { border-bottom: 1px solid #424242; border-top: 1px solid #081121; }