Skip to content

Instantly share code, notes, and snippets.

View strsar's full-sized avatar

Scott Trsar strsar

View GitHub Profile
@mrwweb
mrwweb / readme.md
Last active September 27, 2024 22:29
The Events Calendar v2 Template Reset & Customizations - Now on Github
@nfsarmento
nfsarmento / nginx-wordpress.conf
Last active November 2, 2025 09:45
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
@rohankhudedev
rohankhudedev / .htaccess
Last active March 26, 2025 09:29
Necessary Apache .htaccess Configuration: Performance and Security settings
## ~-~-~- How to use ~-~-~-
# You can directly download as use as it is.
# Everything is listed is only perfomance and security related lines
# Validate .htaccess from http://www.htaccesscheck.com/
# Disable Directory Browsing: Security
Options All -Indexes
# If a dir is a symbol link, follow the link
@cliffordp
cliffordp / functions.php
Last active December 8, 2022 23:56
Shortcode to display an edit link to each Venue (or Organizer) not used by any Event (All Events, not just Upcoming Events). For https://theeventscalendar.com/support/forums/topic/removing-unlinked-venues-organizers/
<?php
/*
* Shortcode to display an edit link to each Venue (or Organizer) not used by any Event (All Events, not just Upcoming Events). Also has a scary single line of commented-out code to then DELETE all such results (they don't even end up in the Trash). You've been warned!
* Examples:
* Venues: [tribe_unused_posts] - https://cl.ly/0q441G1I3I05
* same as above: [tribe_unused_posts type=venues]
* Venues with Debug: [tribe_unused_posts debug=true] - https://cl.ly/2v0S2z420x0U
* Organizers: [tribe_unused_posts type=organizers] - https://cl.ly/1H3q2o1w2o3v
* Organizers with Debug: [tribe_unused_posts type=organizers debug=true] - https://cl.ly/0Y2s1k1n0T0R
* Note: if multiple Organizers are assigned to an Event, there will be multiple _EventOrganizerID meta keys with single values, not a single _EventOrganizerID key with an array or comma-separated list of values.
@mtinsley
mtinsley / Lazy Image Size
Created June 7, 2015 19:02
Generate image sizes on the fly for WordPress
/**
* Create an image with the desired size on-the-fly.
*
* @param $image_id
* @param $width
* @param $height
* @param $crop
*
* @return array
*/
@jfloff
jfloff / mamp.md
Last active October 31, 2025 18:50
How to get MAMP to work with SSL ... Yes really.

First of all you need to be able to run MAMP in port 80. This is a "heat check" if you don't have any process jamming http ports. You can check it like this:

sudo lsof | grep LISTEN

If you do happen to have any process with something like this *:http (LISTEN), you are in trouble. Before with adventure check if it isn't MAMP itself (yeah, you should close that beforehand)

ps <pid of that process>

If you don't see MAMP, you are in good hands, I have just the thing for you: