Skip to content

Instantly share code, notes, and snippets.

View awatertrevi's full-sized avatar

Trevi Awater awatertrevi

View GitHub Profile
@awatertrevi
awatertrevi / sitemap_comparer.py
Created April 15, 2025 21:35
sitemap_comparer.py
import requests
import xml.etree.ElementTree as ET
from urllib.parse import urlparse, urljoin
visited_sitemaps = set()
def normalize_url(url):
"""Return only the path and query part of a URL, for cross-host matching."""
parsed = urlparse(url.strip())
return parsed.path + ('?' + parsed.query if parsed.query else '')
@awatertrevi
awatertrevi / ValueConverterGroup.cs
Last active June 11, 2024 19:32
ValueConverterGroup with parameters.
public class ValueConverterGroup : List<IValueConverter>, IValueConverter
{
private string[] _parameters;
private bool _shouldReverse = false;
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
ExtractParameters(parameter);
if (_shouldReverse)
@awatertrevi
awatertrevi / NoRippleListViewRenderer.cs
Created July 16, 2017 20:53
Removes the material ripple effect on the Xamarin.Forms Android ListView.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;