Skip to content

Instantly share code, notes, and snippets.

View jamescridland's full-sized avatar

James Cridland jamescridland

View GitHub Profile
SELECT count(*),useragent FROM cloudfront_logs
WHERE "date" BETWEEN DATE '2019-01-01' AND DATE '2019-01-31'
AND uri LIKE '/audio/%' AND bytes>750000 GROUP BY useragent ORDER BY useragent
@jamescridland
jamescridland / chromebook-gatsby.md
Last active February 3, 2019 00:57
Chromebook setup for Gatsby

This assumes you're running ChromeOS with Linux inside.

Turn on Linux

  • Hit the clock in the taskbar
  • Hit the settings cog
  • Type "Linux" in the search at the top
  • Press the big button that enables Linux ('turn on' then 'install').

Wait for a bit while it does its thing. (Wait for a bit, honestly, don't idly search the web, things will go wrong).

@jamescridland
jamescridland / links.php
Created November 13, 2019 01:47
[MOD] get total clicks per link in a newsletter
@jamescridland
jamescridland / commandline
Created January 4, 2020 10:00
To add an image to a podcast
ffmpeg -i podnews200103.mp3 -i podnews200103.jpeg -map 0:0 -map 1:0 -c copy -id3v2_version 3 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" podnews200103withart.mp3
@jamescridland
jamescridland / favicons.txt
Created November 17, 2021 02:09
All you really need for favicons
This is all you need...
<link rel="icon" href="https://podnews.net/static/favicon.ico" sizes="any">
<link rel="icon" href="https://podnews.net/static/favicon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" type="image/png" href="/f/apple-icon.png"/>
The top one will only load if your browser doesn't support SVG icons
The second one will load if it does (most do)
The third is needed for some proprietary Apple nonsense.
@jamescridland
jamescridland / helipad.md
Last active January 23, 2022 09:20
Helipad useful debugging tools for Helipad app

Get the local database

On your Mac...

scp umbrel@umbrel.local:~/umbrel/app-data/helipad/data/database.db ~/

... this will download the SQLite database from the Umbrel, and dump it into your home directory. Use DB Browser for SQLite to view it.

@jamescridland
jamescridland / op3-grab-day.php
Last active November 29, 2022 02:29
Get all OP3 podcast hits from a single day
<?php
// To get all podcast hits on a specific day
// Very rough PHP code from james@crid.land
if (empty($config['op3-bearer'])) {
// Grab a API key here: https://op3.dev/api/keys
// Get the bearer and add it in this line below
// For testing purposes, the preview bearer given here will also work
$config['op3-bearer']="preview07ce";