Skip to content

Instantly share code, notes, and snippets.

@mucaho
mucaho / yt_restore_video_time.user.js
Created December 7, 2021 06:35
YouTube restore video time - ViolentMonkey user script
// ==UserScript==
// @name YouTube restore video time
// @namespace Violentmonkey Scripts
// @match https://*.youtube.com/*
// @grant none
// @version 1.0
// @author mucaho
// @description -
// ==/UserScript==
@mucaho
mucaho / README.md
Created July 14, 2022 10:10
Google Sitemap Test

Minimum working example for issue described in https://support.google.com/webmasters/thread/171071268?hl=en

  • Requires installation of Node.js

  • Put these files into a directory, run npm install to install dependencies

  • Use ssh -R 80:localhost:8080 localhost.run to setup a temporary tunnel to your local machine, leave that shell open

  • Copy & paste the publicly accessible tunnel url that will be established, e.g. https://XXX.lhrtunnel.link

  • Open Google Search Console and create a new URL prefix property with that tunnel link

  • Use the meta tag verification method and paste it into the project's index.html file's header

@mucaho
mucaho / arel_cheatsheet_on_steroids.md
Created April 19, 2025 11:22 — forked from ProGM/arel_cheatsheet_on_steroids.md
Arel cheatsheet on Steroids

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias

@mucaho
mucaho / arel_helpers.rb
Created April 19, 2025 11:23 — forked from hadees/arel_helpers.rb
Arel Helpers
module ArelHelpers
extend self
def self.included(base)
base.extend self
end
def asterisk(arel_table_or_model)
arel_table, columns = case arel_table_or_model
when Arel::Table
@mucaho
mucaho / thoughts_on_yaes.md
Last active July 20, 2025 21:52
YAES: Thoughts on context-based capability passing style for state threading and integration into tagless-final application

First creation date: 2025-04-20
Latest update date: 2025-04-24

Changelog

  • 2025-04-24: Updated solution for state-threading

Table of Contents

@mucaho
mucaho / instructions.sh
Created July 11, 2025 08:27
MySQL dump diff (Darwin)
# Instructions for darwin coreutils
# credits: https://stackoverflow.com/questions/3840908/how-do-i-see-the-differences-between-2-mysql-dumps
cd /to/appropriate/working/dir
docker exec -ti mysql5.7 /bin/bash
> mysqldump --skip-opt DB_NAME > prior.sql
> exit
docker cp mysql5.7:/prior.sql prior.sql
sed -i='' -e "s/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/0000-00-00 00:00:00/g" prior.sql