Skip to content

Instantly share code, notes, and snippets.

View martyglaubitz's full-sized avatar

Marty Glaubitz martyglaubitz

View GitHub Profile
@martyglaubitz
martyglaubitz / jcr2sqlite.py
Created July 6, 2017 18:20
Creates an SQLite database from a Magnolia JSON dump
import json
import sqlite3
def load_jcr_json(filePath: str):
with open(filePath) as file:
return json.load(file)
nodes_scheme = '''
CREATE TABLE IF NOT EXISTS nodes (
@martyglaubitz
martyglaubitz / GaussianBlurTransformation.java
Last active September 3, 2017 13:31
A gaussian blur transformation for picasso, using renderscript.
import android.content.Context;
import android.graphics.Bitmap;
import android.support.v8.renderscript.Allocation;
import android.support.v8.renderscript.Element;
import android.support.v8.renderscript.RenderScript;
import android.support.v8.renderscript.ScriptIntrinsicBlur;
import com.squareup.picasso.Transformation;
public class GaussianBlurTransformation implements Transformation {
@martyglaubitz
martyglaubitz / select_driver.cpp
Last active September 7, 2019 12:20
Utility to automatically select the best suitable video driver for Irrlicht
#include <iostream>
#include "select_driver.h"
IrrlichtDevice* createDeviceWithBestGraphicsDriver(dimension2d<u32> resolution)
{
for (auto driverType : driverTypesByPreference)
{
IrrlichtDevice *result = createDevice( driverType, resolution, 16,
@martyglaubitz
martyglaubitz / check_sitemap.py
Created May 6, 2020 11:41
Check urls in sitemap
import csv
import datetime
import io
import sys
import urllib.request
import xml.dom.minidom
def get_sitemap_urls(sitemap_url):
response = urllib.request.urlopen(sitemap_url)
@martyglaubitz
martyglaubitz / sitemap_lighthouse.py
Last active May 21, 2021 08:22
Script which given a URL to a Sitemap, takes each URL and performs a Lighthouse check on it
import csv
import dataclasses
import json
import io
import os
import os.path
import subprocess
import sys
import urllib.parse
import urllib.request