Skip to content

Instantly share code, notes, and snippets.

View f4h3m's full-sized avatar
🏠
Working from home

Fahem Ahemd f4h3m

🏠
Working from home
View GitHub Profile
@alexander-young
alexander-young / functions.php
Created January 17, 2022 17:00
WP Basic Cleanup
<?php
// //remove emoji support
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
// // Remove rss feed links
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );
@hasinhayder
hasinhayder / admin-ssl-vesta.sh
Last active March 21, 2022 19:51
Install Admin Panel SSL Cert for VestaCP using LetsEncrypt
v-change-sys-hostname somedomain.com
v-add-letsencrypt-domain 'admin' $HOSTNAME '' 'yes'
# v-add-letsencrypt-domain 'admin' $HOSTNAME '' 'no'#mail domain = no
v-update-host-certificate admin $HOSTNAME
echo "UPDATE_HOSTNAME_SSL='yes'" >> /usr/local/vesta/conf/vesta.conf
@braginteractive
braginteractive / gulpfile.js
Created August 13, 2018 19:41
Gulp 4 and WordPress Development
// Load all the modules from package.json
var gulp = require( 'gulp' ),
plumber = require( 'gulp-plumber' ),
autoprefixer = require('gulp-autoprefixer'),
watch = require( 'gulp-watch' ),
jshint = require( 'gulp-jshint' ),
stylish = require( 'jshint-stylish' ),
uglify = require( 'gulp-uglify' ),
rename = require( 'gulp-rename' ),
notify = require( 'gulp-notify' ),
@gaearon
gaearon / modern_js.md
Last active October 25, 2024 06:12
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@mrfoxtalbot
mrfoxtalbot / autopupulate-cf7-posts.php
Last active August 21, 2022 12:17
Auto-Populate Contact Form 7 field with post titles
<?php // Auto-Populate Contact Form
function mrfx_add_plugin_list_to_contact_form ( $tag, $unused ) {
if ( $tag['name'] != 'add-this-tag-to-CF7-field' )
return $tag;
$args = array ( 'post_type' => 'post-type-slug-goes-here',
'numberposts' => 99,
'orderby' => 'title',
@dtbaker
dtbaker / code.php
Last active May 21, 2022 10:48
Add a custom control to an existing Elementor widget
// This example will add a custom "select" drop down to the "Image Box"
// This will change the class="" on the rendered image box so we can style the Image Box differently
// based on the selected option from the editor.
// The class will be "my-image-box-style-blue" or "my-image-box-style-green" based on the selected option.
add_action('elementor/element/before_section_end', function( $section, $section_id, $args ) {
if( $section->get_name() == 'image-box' && $section_id == 'section_image' ){
// we are at the end of the "section_image" area of the "image-box"
$section->add_control(