Skip to content

Instantly share code, notes, and snippets.

@trogau
trogau / Average.js
Created June 18, 2020 09:18 — forked from johnnoel/Average.js
JavaScript ES6 Classes for perceptual image hashing
import Colour from './Colour';
import Resample from './Resample';
/**
* Average hash for images
*
* @author John Noel <john.noel@chaostangent.com>
* @see http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
* @see https://github.com/jenssegers/imagehash/blob/master/src/Implementations/AverageHash.php
*/
@trogau
trogau / cloudwatch_log_insights_mysql_slow_query_examples.md
Created April 8, 2024 04:20 — forked from qiangxue/cloudwatch_log_insights_mysql_slow_query_examples.md
CloudWatch Log Insights query examples for MySQL slow query log.

Filtering queries

Find slowest write queries

parse @message /Query_time: (?<queryTime>.*?) Lock_time: (?<lockTime>.*?) Rows_sent: (?<rowsSent>.*?) Rows_examined: (?<rowsExamined>.*?)\s(?<query>.*?)$/
  | filter @message like /(?i)insert/
  | sort queryTime desc
  | limit 10