Skip to content

Instantly share code, notes, and snippets.

View benklocek's full-sized avatar

Ben Klocek benklocek

View GitHub Profile
@cliffordp
cliffordp / functions.php
Last active August 3, 2021 09:58
The Events Calendar: v2 Views: Include the next 3 upcoming events after each post unless it's a TEC post or archive.
<?php
/**
* The Events Calendar: v2 Views: Include the next 3 upcoming events after each post unless it's a TEC post or archive.
*
* Tested working with TEC v5.1.1.
* Outputs a portion of v2's List View's HTML rendering without full styles/scripts.
* But this isn't the best way to use v2's views. For a lot of scenarios, it's better to just create your own new view.
*
* @link https://gist.github.com/cliffordp/9994cf05f6475922f451eaeacef2cd3c This snippet.
@cliffordp
cliffordp / functions.php
Last active May 22, 2020 21:10
The Events Calendar (V2 Views): Remove the "This event has passed." notice from single events.
<?php
/**
* The Events Calendar (V2 Views): Remove the "This event has passed." notice from single events.
*
* FYI: There are other places this same notice displays, such as embed view. To remove the notice from everywhere,
* remove the code snippet's "if..." logic.
*
* @link https://gist.github.com/cliffordp/82836c507db01515745db6e5172f4f76 This snippet.
* @link https://share.getcloudapp.com/YEud5m7d Screenshot of the notice that gets removed.
*/
@cliffordp
cliffordp / functions.php
Last active February 8, 2022 00:11
Override The Events Calendar's V2 Views from a custom plugin location
<?php
/**
* Add your own plugin as a template override location for The Events Calendar, Event Tickets, and related plugins. Only
* for TEC's V2 Views and ET's addons/overrides of TEC's V2 Views. Still need the old snippet for overriding ET's files.
*
* Each custom array's `path` is whatever you want it to be (i.e. customizable) up until the 'v2' part of each
* template's override path. We chose to keep it as `tribe/events` and `tribe/tickets` for simplicity.
* So if the TEC location for a view is:
* /wp-content/plugins/the-events-calendar/src/views/v2/list/event/featured-image.php
* Then this plugin's override location would be:
<?php
/*
Plugin Name: Beaver Builder Global JS Reset
Description: Resets global JS and self deactivates.
Author: <Simon>
Version: 1.0
*/
class BB_Global_JS_Reset {
function __construct() {
include_once ABSPATH . '/wp-admin/includes/plugin.php';
@herewithme
herewithme / script.sh
Created November 19, 2018 16:13
Set a role for each users for all sites for WordPress Multisite
for url in $( wp site list --allow-root --field="url" --url="https://XXX" );
do
echo $url;
wp --allow-root user list --network --url="https://XXX" --field=id | xargs -I % wp --allow-root user set-role % administrator --url=$url
done;

Web Design Contract (open-source)

Between [your name] and [their name]

Summary:

You ([their name]), located at [customer address] are hiring me ([your name]) located at [company address] to [design and develop a web site] for the estimated total price of [total] as outlined in our previous correspondence.

What do both parties agree to do?

@kevinSuttle
kevinSuttle / touch-icons.html
Last active December 18, 2022 17:15
Touch icon link syntax
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png">
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≤ 6: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png">
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≥ 7: -->
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="apple-touch-icon-76x76-precomposed.png">
<!-- For iPhone with high-resolution Retina display running iOS ≤ 6: -->
@retgef
retgef / pug-bomb.php
Created June 24, 2012 07:46
Pug Bomb API Endpoint WordPress Plugin
<?php
/*
Plugin Name: Pug Bomb API Endpoint
Description: Adds an API endpoint at /api/pugs/$n_pugs
Version: 0.1
Author: Brian Fegter
Author URL: http://coderrr.com
*/
class Pugs_API_Endpoint{
@trey
trey / my_git_workflow.md
Created May 18, 2012 03:14
My Git Workflow

My (somewhat outdated) Git Workflow

Local Branches

There are some common hickups I see in the day-to-day use of Git that can be fairly easily remedied by the liberal use of local branches.

When I start any new work (or at the very least before I commit my work), I create a new local branch named for the feature on which I'm working.

$ git co -b robotic-turtles
@markjaquith
markjaquith / .all
Last active October 10, 2018 15:38
Bash stuff
for f in ~/Dropbox/bash/*; do source $f; done