Skip to content

Instantly share code, notes, and snippets.

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 April 4, 2021 04:46
[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 May 2, 2024 07:30
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] ) )
@JacobJohansen
JacobJohansen / AuthyToOtherAuthenticator.md
Created October 20, 2017 15:12 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes (beware, through Google) for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My gues