Skip to content

Instantly share code, notes, and snippets.

@yusufades
yusufades / scubadoctorSubsurface.xml
Last active October 2, 2023 05:13
Subsurface victorian dive sites List
<divesites>
<site description="Dive Type: Wall Dive; Access Type: Boat access" gps="-38.284883,144.639000" name="12lb Reef">
<notes>
https://www.scubadoctor.com.au/divesite.htm?site=12lb-Reef
</notes>
<geo cat="2" origin="0" value="Australia">
</geo>
</site>
<site description="Dive Type: Wall Dive; Access Type: Boat access" gps="-38.294233,144.624633" name="16lb Reef">
<notes>
from bs4 import BeautifulSoup
scubadoctorFP = 'scuba-doctor-dive-map.kml'
outputFP = 'scubadoctorSubsurface.xml'
with open(scubadoctorFP, 'r') as kml:
kmlSoup = BeautifulSoup(kml.read(), features="xml")
kml.close()
soup = BeautifulSoup()
@yusufades
yusufades / svg-rounded-rect-path.js
Last active March 20, 2020 13:23
Generate svg path for rounded rectangle with constant radius. Working example/calculator available here https://jsfiddle.net/theya222/b5jLydqh/
/***
* Generates the svg path data for a rounded rectangle
* Rounded corners are approximated by Cubic bezier curve with control point at an end point and the other at the corner
* @license MIT License
* Copyright (c) 2018 Yusuf Ades
* @param {Object} dimension - Dimensions of rectangle.
* @param {number} width - Width.
* @param {number} height - Height.
* @param {number} [r=0] - Corner Radius. Keep this smaller than half of width or height.
* @param {number} [x=0] - Offset from top left corner in x axis. default 0.