Skip to content

Instantly share code, notes, and snippets.

@benjibee
benjibee / AppServiceProvider.php
Last active January 10, 2023 15:16
Use ngrok URLs in Laravel for all assets, generated URLs, etc.
<?php
namespace App\Providers;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;
class AppServiceProvider extends ServiceProvider
{
@benjibee
benjibee / delete_posts.sql
Created March 15, 2023 15:50
WordPress SQL Query: delete posts and post meta for posts older than N days
DELETE p, pm
FROM wp_posts p
INNER
JOIN wp_postmeta pm
ON pm.post_id = p.ID
WHERE p.post_type = 'page'
AND p.post_date < (NOW() - INTERVAL 120 DAY);
@benjibee
benjibee / scrape.js
Created February 10, 2018 13:19
A little script to import starred places saved as geoJSON data from Google Maps. Could be better. Works.
// This script is meant to import Google Maps starred places into
// another Google account.
// Given a geoJSON file of Google Maps starred places (places.json)
// exported by Google takeout (account backup) this script should
// open each place URL and manually click save.
// Upon first run, it's best to stop it and manually login to your
// Google account otherwise you'll run into a non-verified device
// issue. Run again and it should continue through with problems.