Skip to content

Instantly share code, notes, and snippets.

View dmccreary's full-sized avatar

Dan McCreary dmccreary

View GitHub Profile
@dmccreary
dmccreary / pico-sdk-mak-install.md
Last active November 6, 2022 15:42
Pico Mac SDK

How to Install the Raspberry Pi Pico SDK on a Mac

I wanted to test FFT on the Raspberry Pi Pico so I could create a real-time spectrum analizer using an LED strip. I have used MicroPython and Thonny for everything up until now. But FFT is only implemented in C for performance reasons. So to get started I had to install the Raspberry Pi Pico SDK on my Mac running Montery.

The Raspbery Pi Pico SDK code is here:

https://github.com/raspberrypi/pico-sdk

I installed it but the examples did not run because brew didn't support the EABI GCC

@dmccreary
dmccreary / 0-self-publishing.md
Created February 7, 2021 14:37 — forked from caseywatts/0-self-publishing.md
Self-Publishing via Markdown
@dmccreary
dmccreary / setup-huggingface-transformers.sh
Last active January 31, 2021 03:41
notes on setting up huggingface transformers on a mac
conda create -n transformers python=3
conda activate transformers
conda install -c huggingface transformers
@dmccreary
dmccreary / add-mkdocs.sh
Created May 25, 2020 19:06
Add mkdocs files to a github repository.
#!/bin/sh
# add mkdocs to git repository
if [ $# -eq 0 ]
then
echo "No arguments supplied. Exiting."
exit 1
fi
if [ -d $1 ]
then
@dmccreary
dmccreary / tigergraph-schema-json-to-gsql.js
Created May 1, 2020 13:28
Node.js script that will convert a TigerGraph schema archive JSON file into GSQL.
#!/usr/local/bin/node
# written by Josh Meekhof
var fs = require("fs");
var content = fs.readFileSync("schema.json");
var schema = JSON.parse(content);
var vertextT = [];
var edgeT = [];
const joiner = (acc, val) => acc + (val + "\n");
@dmccreary
dmccreary / find-big-images-in-ppt-file.sh
Last active February 26, 2024 16:49
Find big images in PowerPoint
#!/bin/sh
# this program has been updated to list both the images and the largest images and the slide numbers together
# get the parameter
echo "working on" "$1"
rm -r /tmp/big-images 2> /dev/null
mkdir /tmp/big-images
# copy the ppt file to /tmp
cp "$1" /tmp/big-images
# rename it to be .zip
mv "/tmp/big-images/$1" "/tmp/big-images/$1.zip"
@dmccreary
dmccreary / skos-prefLabel-with-opt-alt.sparql
Created July 14, 2017 20:32
SKOS prefLabels with optional altLabels.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skosxl: <http://www.w3.org/2008/05/skos-xl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT ?s ?p ?o
WHERE
{
?s skosxl:prefLabel ?o .
OPTIONAL {?s skosxl:altLabel ?o}
}
@dmccreary
dmccreary / list-all-SPARQL-Prefixes.xqy
Created July 14, 2017 20:12
List all the SPARQL prefixes
import module namespace sem = "http://marklogic.com/semantics" at "/MarkLogic/semantics.xqy";
declare namespace map="http://marklogic.com/xdmp/map";
let $prefixes-map := <map>{sem:prefixes("skosxl: http://www.w3.org/2008/05/skos-xl#")}</map>
return $prefixes-map/map:map/map:entry/map:value/text()
@dmccreary
dmccreary / list-all-SPARQL-Prefixes.xqy
Created July 14, 2017 20:12
List all the SPARQL prefixes
import module namespace sem = "http://marklogic.com/semantics" at "/MarkLogic/semantics.xqy";
declare namespace map="http://marklogic.com/xdmp/map";
let $prefixes-map := <map>{sem:prefixes("skosxl: http://www.w3.org/2008/05/skos-xl#")}</map>
return $prefixes-map/map:map/map:entry/map:value/text()
@dmccreary
dmccreary / expand-keywords.sparql
Last active July 14, 2017 18:28
Sample Keyword Expansion SPARQL Query
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skosxl: <http://www.w3.org/2008/05/skos-xl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT (str(?prefTerm) AS ?pTerm) (str(?altTerm) AS ?aTerm)
FROM <urn:x-evn-master:BenefitSectionDetails0>
FROM <urn:x-evn-master:BenefitSection>
WHERE {
?s (skosxl:prefLabel | skosxl:altLabel) / skosxl:literalForm ?allTerms .
FILTER (LCASE(str(?allTerms)) = LCASE('IUD'))