Skip to content

Instantly share code, notes, and snippets.

View Utzel-Butzel's full-sized avatar
🐢
🇪🇺

Robert Gühne Utzel-Butzel

🐢
🇪🇺
View GitHub Profile
@Utzel-Butzel
Utzel-Butzel / cloudinary-rehype-images.jsx
Last active July 22, 2022 00:41
A rehype plugin for mdx (markdown) to add metadata and cloudinary information to images
import { Cloudinary } from "cloudinary-core";
import { getImage } from "../../lib/api";
import urlGenerator from "../../lib/cloudinaryHelper";
function searchTreeWrapper(element, matchingTitle) {
var result = [];
const searchTree = (element, matchingTitle) => {
if (element.name == matchingTitle) {
result.push(element);
@daviesesiro
daviesesiro / image-resize.js
Last active June 27, 2024 01:05
a minimal function to resize an image on the browser in JavaScript
/**
* Resizes an Image File and converts it to a dataurl string.
* @param imageFile the image file (probably from a file input)
* @param resize_width The width you want the image to be
* @param quality quality of the resize image 0 - 1
*/
const resizeImage = ({
resizeWidth = 400,
imageFile,
quality = 1,
@teckliew
teckliew / ExportSVGLayers.jsx
Created August 14, 2019 05:46
Adobe Illustrator script that exports SVG for every layer in the document.
/**********************************************************
ExportSVGLayers.jsx
DESCRIPTION
For Adobe Illustrator.
This script takes your active document and export one
SVG per layer.
Best used for exporting many layers with the same artboard
/*
* This script fetches all color styles from a Figma team/document.
*
* Dependencies:
*
* - node-fetch
*
* Due to a limitation in the Figma /styles endpoint, we need to use a
* document for actually using the colors in a color grid 🙄That's why
* we're both fetching from /styles and /files below.
@veproza
veproza / AGPS.md
Last active October 15, 2024 13:53
Getting u-blox MAX-7C GPS to work with Assisted A-GPS

Getting u-blox MAX-7C GPS to work with Assisted A-GPS

So you got your u-blox GPS and wired it up only to look at it struggling to get a valid fix? Under less than ideal conditions, it can take a better part of half an hour. That's because unlike your smartphone GPS, it doesn't have the luxury of having downloaded all the auxiliary navigation data (almanacs and the lot) out-of-band, via fast mobile connection. Instead it relies on the satellite's signal itself, which is being transmitted to you at meager 50 bits per second (I'm not missing "kilo" there, it's three orders of magnitude slower than your 2G GPRS connection).

Luckily, the u-blox receivers are fitted with what the company calls "AssistNow" capability and it does exactly the same thing your iPhone does - feeds the GPS with pre-downloaded almanacs, speeding up the acquisition process to mere seconds.

In principle, the process looks easy enough - we just need to download the data, and then push them to the receiver. Sadly, the AssistNow documentat

@hissy
hissy / gist:ebb1d317f9abc190b901
Last active January 7, 2023 08:43
[Really Simple CSV Importer] Import ACF Google Map Field https://wordpress.org/support/topic/import-acf-google-map-field
"post_title","post_type","lat","lng"
"Map","post",35.710115,139.810203
@jbspeakr
jbspeakr / German-Zip-Codes.csv
Created January 18, 2013 16:46
list of German zip codes (Postleitzahl), including dialing code, name of the city and federal state.
We can't make this file beautiful and searchable because it's too large.
Ort;Zusatz;Plz;Vorwahl;Bundesland
Aach;b Trier;54298;0651;Rheinland-Pfalz
Aach;, Hegau;78267;07774;Baden-Württemberg
Aachen;;52062;0241;Nordrhein-Westfalen
Aachen;;52064;0241;Nordrhein-Westfalen
Aachen;;52066;0241;Nordrhein-Westfalen
Aachen;;52068;0241;Nordrhein-Westfalen
Aachen;;52070;0241;Nordrhein-Westfalen
Aachen;;52072;0241;Nordrhein-Westfalen
Aachen;;52074;0241;Nordrhein-Westfalen