Skip to content

Instantly share code, notes, and snippets.

/* How to add additional field in user profile add-edit in wordpress start */
add_action( 'show_user_profile', 'custom_user_fields' );
add_action( 'edit_user_profile', 'custom_user_fields' );
add_action( "user_new_form", "custom_user_fields" );
function custom_user_fields( $user )
{
$user_fb_link = get_the_author_meta( 'user_fb_link', $user->ID);
$user_gender = get_the_author_meta( 'user_gender', $user->ID);
?>
<h3><?php _e("Custom User information", "blank"); ?></h3>
@orfeomorello
orfeomorello / functions.php
Last active May 21, 2022 19:06
Customize Wordpress Profile
function remove_personal_options(){
echo '<script type="text/javascript">jQuery(document).ready(function($) {
$(\'form#your-profile > h2:first\').remove(); // remove the "Personal Options" title
$(\'form#your-profile tr.user-rich-editing-wrap\').remove(); // remove the "Visual Editor" field
$(\'form#your-profile tr.user-admin-color-wrap\').remove(); // remove the "Admin Color Scheme" field
$(\'form#your-profile tr.user-comment-shortcuts-wrap\').remove(); // remove the "Keyboard Shortcuts" field
@orfeomorello
orfeomorello / how-to-compile-raspberry.txt
Created October 20, 2017 15:35
Best Compilation Flags for Raspberry
If you have Raspberry 2 (V1.1): Broadcom BCM2836 ARMv7 Quad Core 32bit Processor, running at 900MHz.
./configure CFLAGS="-Ofast -mtune=cortex-a7 -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -ffast-math" CXXFLAGS="-Ofast -mtune=cortex-a7 -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -ffast-math"
If you have Raspberry 3
./configure CFLAGS="-Ofast -mtune=cortex-a53 -mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mneon-for-64bits -ffast-math" CXXFLAGS="-Ofast -mtune=cortex-a53 -mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mneon-for-64bits -ffast-math"
Launch the "make" command to force the code to compile always
@orfeomorello
orfeomorello / app.py
Created February 8, 2024 15:04
Stable Diffusion Turbo example for Intel Arc A770 running with IPEX (intel extension for pytorch)
from diffusers import AutoPipelineForText2Image, DPMSolverMultistepScheduler, AutoencoderKL
import torch
import intel_extension_for_pytorch as ipex
# Initialize LoRA model and weights
#lora_model_id = "Linaqruf/style-enhancer-xl-lora"
#lora_filename = "style-enhancer-xl.safetensors"
#FOR REAL PHOTO AND ART