Skip to content

Instantly share code, notes, and snippets.

@plugnburn
plugnburn / olc.js
Last active November 8, 2023 03:39
TinyOLC - smallest Open Location Code implementation in JS
/**
* TinyOLC - Open Location Code for smallest applications
* Differences from Google's open-source JS implementation:
* - less than 600 bytes minified (as opposed to over 4.5 KB from Google)
* - only 2 methods exposed - encode (lat, lng => str) and decode (str => [lat, lng])
* - only floating point degrees accepted as encoding input (positive as N and E, negative as S and W)
* - no short code resolution
* - no area encoding, only points with 11-digit resolution
* - assuming the block lower left corner only when decoding a low-res code
* - no validation checks
@vsoch
vsoch / index.php
Last active June 2, 2024 14:28
Generate RSS feed for files in a directory folder. Put this file in a folder with files, modify the $allowed_ext variable to customize your extensions, and $feedName, $feedDesc, $feedURL, and $feedBaseURL. Then navigate to the folder on the web to see the xml feed. Done!
<?php
header('Content-type: text/xml');
/*
Runs from a directory containing files to provide an
RSS 2.0 feed that contains the list and modification times for all the
files.
*/
$feedName = "My Audio Feed";
$feedDesc = "Feed for the my audio files in some server folder";