Skip to content

Instantly share code, notes, and snippets.

@lehmanjo
lehmanjo / gist:39adc6222c663846392907f9ab42f784
Last active July 21, 2024 19:39
Steam Deck - Install Mod Organizer 2
Credits go to https://github.com/rockerbacon/modorganizer2-linux-installer
Install 'protontricks'
$ sudo flatpak install com.github.Matoking.protontricks
Download Mod Organizer for Linux
$ cd ~/Downloads/
$ mkdir mo2
$ cd mo2
$ wget https://github.com/rockerbacon/modorganizer2-linux-installer/releases/download/4.3.0/mo2installer-4_3_0.tar.gz
Code Key
0 KEY_NONE
1 KEY_ESCAPE
2 KEY_1
3 KEY_2
4 KEY_3
5 KEY_4
6 KEY_5
7 KEY_6
8 KEY_7
@jeherve
jeherve / plugin.php
Last active May 5, 2024 02:49
[Post Views For Jetpack] Display a Stats counter at the top of every post, with a "Views:" heading.
<?php
/**
* Display a Stats counter at the top of every post, with a "Views:" heading.
* @see https://wordpress.org/support/topic/page-views-off/
*
* @param string $content Post content.
*/
function jeherve_custom_display_post_views( $content ) {
$post_views = sprintf(
'<div class="stats_counter sd-content"><h3 class="sd-title">%1$s</h3><div class="sd-content">%2$s</div></div>',
@kennyeliason
kennyeliason / makewpsuck.sh
Last active July 4, 2024 23:45
Make WP Suck Less or More
#!/bin/bash
# Make sites into bedrock or normal WordPress
# Version 2.0
# Copyright (c) Kenny Eliason
set -a
source .env
set +a
@jchristopher
jchristopher / functions.php
Last active May 1, 2021 09:39
Change the WordPress search query parameter from 's' to something else
<?php
add_filter('init', function(){
global $wp;
$wp->add_query_var( 'search_query' );
$wp->remove_query_var( 's' );
} );
@KaineLabs
KaineLabs / yzc_buddyboss_global_search_integration.php
Created April 3, 2019 03:20
Make Buddyboss Global Search Supports Youzer Posts
<?php
/**
* Make Buddyboss Global Search Supports Youzer Posts.
*/
function yzc_buddyboss_global_search_integration( $sql) {
// Post Types.
$post_types = "'activity_update', 'activity_link', 'activity_file', 'activity_file', 'activity_audio', 'activity_photo', 'activity_video', 'activity_quote', 'activity_status','activity_slideshow'";
@aers
aers / count_loaded_refs_in_load_order.pas
Created January 15, 2019 04:40
xedit count loaded refrs in load order
Unit CountLoadedRefs;
Var
giTemporaryCount: Integer;
giPersistentCount: Integer;
giPluginTemporaryCount: Integer;
giPluginPersistentCount: Integer;
Const
gtPersistent = 8;
@KaineLabs
KaineLabs / yz_enable_wpforo_activity_posts.php
Created November 1, 2018 14:36
Enable Activity WP-Foro Posts
<?php
/**
* Add Activity New Allowed Actions.
*/
function yzc_add_show_everything_filter_actions( $actions ) {
$actions[] = 'wpforo_like';
$actions[] = 'wpforo_post';
$actions[] = 'wpforo_topic';
Scriptname _RC_QuestScript extends Quest
Keyword Property ActorTypeNPC Auto
Actor Property PlayerRef Auto
GlobalVariable Property _RC_GlobalToggleMessages Auto
GlobalVariable Property _RC_GlobalCapacityBase Auto
GlobalVariable Property _RC_GlobalCuirassBase Auto
GlobalVariable Property _RC_GlobalCuirassPerc Auto
@jordymeow
jordymeow / wplr_update_media_custom_meta.php
Created July 26, 2018 06:01
WP/LR Sync: Synchronize a custom meta/field with EXIF/IPTC data
add_action( "wplr_add_media", 'myapp_update_media_meta', 10, 2 );
add_action( "wplr_update_media", 'myapp_update_media_meta', 10, 2 );
function myapp_update_media_meta( $mediaId, $galleryID ) {
global $wplr;
$image = wp_get_attachment_url( $mediaId );
$size = getimagesize($image, $info);
if ( isset( $info['APP13'] ) ) {
$iptc = iptcparse( $info['APP13'] );
if ( isset( $iptc["2#090"][0] ) )