Skip to content

Instantly share code, notes, and snippets.

@erishel
erishel / private_fork.md
Created May 26, 2024 10:23 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@erishel
erishel / wpf-clear-orphaned-cron.php
Last active August 22, 2019 21:10
Clears orphaned cron jobs from WPF's WooCommcere integration
<?php
function clear_cron() {
if( isset( $_GET['wpf_clear_cron'] ) ) {
$cron = get_option( 'cron' );
foreach( $cron as $key => $cron_data ) {
@erishel
erishel / functions.php
Last active April 8, 2019 13:37 — forked from cliffordp/functions.php
Set default quantity of 1 and READONLY for all tickets: Same as https://gist.github.com/cliffordp/5b57df71be8b52f595817ddbf81acdab except make quantity readonly
<?php
/**
* Set default quantity of 1 and READONLY for all tickets:
* - Event Tickets RSVP
* - Event Tickets Plus WooCommerce
* - Event Tickets Plus Easy Digital Downloads
*
* From https://gist.github.com/cliffordp/80b33455779b74ec49f6ea3033cb47bf
*
* Same as https://gist.github.com/cliffordp/5b57df71be8b52f595817ddbf81acdab except make quantity readonly
@erishel
erishel / functions.php
Last active March 28, 2019 13:42 — forked from pablo-sg-pacheco/functions.php
Wordpress - Password protect a custom post type programmatically
<?php
//Password Protect programmatically
function passwordProtectPosts($post_object) {
//Checks if current post is a specific custom post type
if ($post_object->post_type!='tribe_events')) {
return;
}
//Checks if current post is from a specific category
@erishel
erishel / functions.php
Created February 7, 2019 21:35 — forked from cliffordp/functions.php
Events Calendar PRO: Change default coordinates and zoom level for Map View's start location (for when there are no event results found, to avoid African coast).
<?php
/**
* Events Calendar PRO: Change default coordinates and zoom level for Map View's
* start location (for when there are no event results found, to avoid African coast).
*
* Change the coordinates to your liking. See the link below for a helpful tool.
* Updated 2018-08-06 because PRO v4.4.30 removed one of the parameters.
*
* @link https://gist.github.com/cliffordp/52d0bfb6d1537a19d158deb351dd9fa7
@erishel
erishel / functions.php
Created January 18, 2019 01:05 — forked from cliffordp/functions.php
Filter the minDate and maxDate for The Events Calendar's "Custom Datepicker Start Date" extension. 7 days prior to Today through 1 month forward from today.
<?php
/**
* Filter the minDate and maxDate for The Events Calendar's "Custom Datepicker
* Start Date" extension, which requires PHP 5.3+.
*
* 7 days prior to Today through 1 month forward from today.
*
* @see Tribe__Extension__Custom_Datepicker_Start_Date::get_min_date()
* @see Tribe__Extension__Custom_Datepicker_Start_Date::get_max_date()
*
@erishel
erishel / tribe-hide-weekend.css
Created November 24, 2018 15:42 — forked from geoffgraham/tribe-hide-weekend.css
The Events Calendar 4.0 // Hide Saturday and Sunday in Month View
/* Hide Weekends the Events Calendar Monday First Day of Week */
.tribe-events-calendar th#tribe-events-sunday,
.tribe-events-calendar th#tribe-events-saturday,
.tribe-events-calendar tr td:first-child,
.tribe-events-calendar tr td:last-child {
display: none;
}
/* Hide Weekends the Events Calendar Monday First Day of Week */
<Files admin-ajax.php>
Order allow,deny
Allow from all
Satisfy any
</Files>
<Files wpspin_light.gif>
Order allow,deny
Allow from all
Satisfy any
</Files>
@erishel
erishel / exclude events category.php
Created November 24, 2018 00:37 — forked from theeventscalendar/exclude events category.php
Excludes specified categories from List and Month views. Add you own categories in line 9.
<?php
/*
* Removes categories "meetup" and "shindig" from list and month views
*/
function tribe_exclude_events_category( $wp_query ) {
// Slugs for the categories you wish to hide
$exclude_cats = array('meetup', 'shindig');
@erishel
erishel / tribe_prevent_ajax_paging.php
Created June 12, 2018 17:41 — forked from elimn/tribe_prevent_ajax_paging.php
MT | TEC | Prevent Next/Prev pages from being loaded via Ajax in List and Month views
<?php
/*
* Prevents Next/Prev pages from being loaded via Ajax in List and Month views
*/
function tribe_prevent_ajax_paging() {
echo "
<script>
jQuery(document).ready(function(){