Skip to content

Instantly share code, notes, and snippets.

View themightymo's full-sized avatar

Toby Cryns themightymo

View GitHub Profile
@matiskay
matiskay / widget-skeleton.php
Created December 14, 2011 19:22
Wordpress Widget Skeleton
<?php
class Widget_Name extends WP_Widget {
function Widget_Name() {
$widget_opts = array(
'classname' => 'your-awesome-class',
'description' => 'Your awesome Description',
);
@boucher
boucher / gist:1750375
Created February 6, 2012 07:09 — forked from siddarth/gist:1379745
Stripe PHP simple example
<?php
require 'path-to-Stripe.php';
if ($_POST) {
Stripe::setApiKey("YOUR-API-KEY");
$error = '';
$success = '';
try {
if (!isset($_POST['stripeToken']))
throw new Exception("The Stripe Token was not generated correctly");
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@danjjohnson
danjjohnson / conditional-lesson-display.php
Last active September 25, 2019 10:18
Sensei - Display lessons on course page only for registered users
add_action( 'sensei_before_main_content', 'sensei_conditional_lesson_display', 10 );
function sensei_conditional_lesson_display() {
if( !is_singular('course') ) return;
global $post, $current_user, $woothemes_sensei;
$is_user_taking_course = Sensei_Utils::user_started_course( $post->ID, $current_user->ID );
if ( ! ( $is_user_taking_course || sensei_all_access() ) ) {
remove_action( 'sensei_single_course_content_inside_after' , array( 'Sensei_Course','the_course_lessons_title'), 9 );
@renventura
renventura / remove-divi-project-post-type.php
Last active November 27, 2022 02:07
Remove the Projects Post Type from Divi by Elegant Themes
<?php //* Mind this opening php tag
/**
* This will hide the Divi "Project" post type.
* Thanks to georgiee (https://gist.github.com/EngageWP/062edef103469b1177bc#gistcomment-1801080) for his improved solution.
*/
add_filter( 'et_project_posttype_args', 'mytheme_et_project_posttype_args', 10, 1 );
function mytheme_et_project_posttype_args( $args ) {
return array_merge( $args, array(
'public' => false,
@ericandrewlewis
ericandrewlewis / gist:95239573dc97c0e86714
Last active December 12, 2023 09:52
Setting up a WordPress site on AWS

Setting up a WordPress site on AWS

This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.

This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.

If you experience any difficulties or have any feedback, leave a comment. 🐬

Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.

@jjeaton
jjeaton / .gitignore
Created August 5, 2015 01:54
WordPress root .gitignore. Ignore everything and then opt-in (exclude from the ignore) for your custom code.
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@themightymo
themightymo / .gitignore NEW
Last active January 18, 2023 23:40 — forked from jjeaton/.gitignore
WordPress root .gitignore. Ignore everything and then opt-in (exclude from the ignore) for your custom code.
# codekit #
###########
.sass-cache/
.codekit-config.json
.config.codekit
# wpengine #
############
*~
@BurlesonBrad
BurlesonBrad / move-proceed-to-checkout.php
Last active November 28, 2020 17:41
Put Checkout button next to the Update Cart button (AWESOME on mobile!!) https://bradgriffin.me/proceed-to-checkout/
add_action( 'woocommerce_cart_actions', 'move_proceed_button' );
function move_proceed_button( $checkout ) {
echo '<a href="' . esc_url( WC()->cart->get_checkout_url() ) . '" class="checkout-button button alt wc-forward" >' . __( 'Proceed to Checkout', 'woocommerce' ) . '</a>';
}
<?php
// override Divi's footer credits output
function et_get_footer_credits()
{
$my_content = '<img href="/my/image/path/" />';
return $my_content;
}