Skip to content

Instantly share code, notes, and snippets.

View reatlat's full-sized avatar
🍋
Life gave me lemons, I forked.

Alex Zappa reatlat

🍋
Life gave me lemons, I forked.
View GitHub Profile
@reatlat
reatlat / README.md
Last active October 4, 2025 18:17
Placeholder gist for the FreshJuice GitHub Gist module demo page. Demo here: https://demo.freshjuice.dev/modules/code-snippet-github-gist

Multi-file example

This gist contains multiple files. Pick one via data-file.

@reatlat
reatlat / example.js
Last active October 4, 2025 18:18
Placeholder gist for the FreshJuice GitHub Gist module demo page. Demo here: https://demo.freshjuice.dev/modules/code-snippet-github-gist
// Code Snippet (GitHub Gist) by FreshJuice 🍊
function hello(name = 'world') {
const msg = `Hello, ${name}!`;
console.log(msg);
return msg;
}
@reatlat
reatlat / example.js
Last active October 4, 2025 18:19
Placeholder gist for the FreshJuice GitHub Gist module — a fruity hello-world with a random emoji 🍊 Demo here: https://demo.freshjuice.dev/modules/code-snippet-github-gist
/**
* example.js — placeholder gist for FreshJuice GitHub Gist module
* 🍊 FreshJuice style: squeeze out a fruity greeting
*/
function squeeze(name = 'world') {
const fruits = ['🍊', '🍓', '🍍', '🥭', '🍑'];
const pick = fruits[Math.floor(Math.random() * fruits.length)];
console.log(`FreshJuice says: Hello, ${name}! ${pick}`);
return `Hello, ${name}! ${pick}`;
#!/usr/bin/env bash
set -euo pipefail
# --- Detect Steam App ID from environment ---
APPID="${SteamAppId:-${STEAM_COMPAT_APP_ID:-}}"
if [[ -z "${APPID}" ]]; then
echo "[RAMCACHE] ERROR: Steam AppID not found in env (SteamAppId / STEAM_COMPAT_APP_ID)."
echo "Launch this via Steam (it sets the vars), or set APPID= manually."
exit 1
fi
@reatlat
reatlat / github-gist-example.js
Last active April 28, 2024 21:49
GitHub Gist Example for FreshJuice CMS HubSpot theme
function greet(name) {
return `Hello, ${name}!`;
}
console.log(greet('World')); // 'Hello, World!'
@reatlat
reatlat / custom-gravatar.php
Last active April 10, 2024 01:50
This snippet allows users to upload a custom avatar image.
<?php
/**
* Custom Gravatar
*
* This snippet adds a custom gravatar field to the user profile page.
* It also adds a filter to replace the default gravatar with the custom one.
* To make it work, you need to have Advanced Custom Fields plugin installed and activated.
*
* Usage:
* 1. Copy this snippet to your theme's directory (e.g. /wp-content/themes/your-theme/inc/custom-gravatar.php)
@reatlat
reatlat / no_mp.bat
Created April 8, 2024 23:46 — forked from natesubra/no_mp.bat
Disable Windows Defender - Powershell
# disable
powershell -command 'Set-MpPreference -DisableRealtimeMonitoring $true -DisableScriptScanning $true -DisableBehaviorMonitoring $true -DisableIOAVProtection $true -DisableIntrusionPreventionSystem $true'
# Or exclude
powershell -command 'Add-MpPreference -ExclusionPath "c:\temp" -ExclusionProcess "c:\temp\yourstuffs.exe"'
@reatlat
reatlat / function.php
Created March 22, 2024 04:18 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@reatlat
reatlat / countries-with-states-provinces-regions.js
Last active February 14, 2024 00:06 — forked from shanebo/countries-with-states-provinces-regions
All countries with their states/provinces/regions in json
var countries = {
"Afghanistan": [
"Badakhshan",
"Badghis",
"Baghlan",
"Balkh",
"Bamian",
"Daykondi",
"Farah",
"Faryab",
@reatlat
reatlat / example.html
Last active February 12, 2024 01:30 — forked from hijonathan/example.html
Generate a unique id in a Jinja template.
<!-- Jinja Unique ID Generator -->
{% macro random_int(len) -%}
{% for n in range(len) %}
{{ [0,1,2,3,4,5,6,7,8,9]|random }}
{% endfor %}
{%- endmacro %}
{% macro unique_id(count_groups=5, group_len=6, separator='-') -%}
{% set parts %}