Skip to content

Instantly share code, notes, and snippets.

View TheSkallywag's full-sized avatar

Skallywag TheSkallywag

View GitHub Profile
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active March 17, 2025 06:52
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@Mariovc
Mariovc / Font.java
Last active March 3, 2020 05:52
Cache your created typefaces to avoid memory leaks.
public enum Font {
OXYGEN_REGULAR("Oxygen-Regular.ttf"),
OXYGEN_LIGHT("Oxygen-Light.ttf"),
OXYGEN_BOLD("Oxygen-Bold.ttf"),
GOTHAM_BOOK("Gotham-Book.ttf"),
GOTHAM_LIGHT("Gotham-Light.ttf"),
GOTHAM_MEDIUM("Gotham-Medium.ttf");
private final String path;
@fevangelou
fevangelou / my.cnf
Last active March 20, 2025 13:52
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated September 2024 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
/**
* Based on the mysql cluster
* @link http://jonisalonen.com/2012/k-means-clustering-in-mysql/
*/
-- SELECT
-- * FROM
-- unnest(kmeans(array(SELECT
-- (
-- lat,
@jaydenseric
jaydenseric / ffmpeg-web-video-guide.md
Last active March 18, 2025 17:57
A quick guide to using FFmpeg to create cross-device web videos.

Video conversion with FFmpeg

Install

On mac:

  1. Download the latest release.
  2. Extract the binary and place it in /usr/local/bin.

Command basics