Skip to content

Instantly share code, notes, and snippets.

View austinginder's full-sized avatar

Austin Ginder austinginder

View GitHub Profile
@lmarburger
lmarburger / backup_pgdump.rake
Created December 13, 2010 21:54
Copy the latest Heroku pgdump to S3 and capture a new one
# pgbackups client from heroku gem
require 'pgbackups/client'
desc 'Backup database'
task(:backup_database => :environment) { backup_database }
desc 'cron'
task :cron => :backup_database
# config.ru for Pow + Wordpress, based on http://stuff-things.net/2011/05/16/legacy-development-with-pow/
# added hackery to work around wordpress issues - Patrick Anderson (patrick@trinity-ai.com)
# clearly this could be cleaner, but it does work
require 'rack'
require 'rack-legacy'
require 'rack-rewrite'
# patch Php from rack-legacy to substitute the original request so
# WP's redirect_canonical doesn't do an infinite redirect of /
@teolopez
teolopez / WordPress Redirect all non-logged-in users
Last active October 5, 2018 23:52 — forked from daltonrooney/gist:1737771
Redirect all non-logged-in users to the login page (private site). Add to functions.php.
<?php
// ----------------------------------------------------------------------------------------
// Redirect all non-logged-in users to the login page (private site). Add to functions.php.
// ----------------------------------------------------------------------------------------
function admin_redirect() {
if ( !is_user_logged_in()) {
wp_redirect( home_url('/wp-admin/') );
exit;
}
@daltonrooney
daltonrooney / acf-migrate-db-pro.php
Last active October 27, 2020 04:34
Prevent ACF Pro license key from being overwritten during WP Migrate DB Pro migration
<?php
/*
Based on http://github.com/deliciousbrains/wp-migrate-db-pro-tweaks
*/
class ACF_WP_Migrate_DB_Pro_Tweaks {
function __construct() {
add_filter( 'wpmdb_preserved_options', array( $this, 'preserved_options' ) );
}
@valeryan
valeryan / WindowsSetup.md
Last active May 4, 2021 09:25
Local WSL Setup

Deprecated in favor of Valet Wiki Page

I set up the wiki page for the valet-wsl project and moved the install guide there. This way it can have user contributions. Please have all disscussions or issues under the valet-wsl project so I can be aware of it. Please go to Valet Wsl Installation Guide

@jacobdubail
jacobdubail / php
Created January 30, 2017 23:44
Function to auto-set your ACF5 Pro license key
function jtd_acf_auto_set_license_keys() {
if ( !get_option('acf_pro_license') && defined('ACF_5_KEY') ) {
$save = array(
'key' => ACF_5_KEY,
'url' => home_url()
);
$save = maybe_serialize($save);
@wpchannel
wpchannel / mu-yoast-seo-disable-notifications.php
Last active April 16, 2023 08:33
Hide annoying notifications after each upgrade of Yoast SEO plugin and others admin notices
<?php if (!defined('ABSPATH')) die('Restricted Area');
/*
* Plugin Name: Disable Yoast SEO Notifications
* Description: Hide annoying notifications after each upgrade of Yoast SEO plugin and others admin notices.
* Version: 1.1
* Author: Aurélien Denis
* Author URI: https://wpchannel.com/
*/
@carlosleopoldo
carlosleopoldo / delete-orphans-usermeta.sql
Last active June 16, 2023 13:23
Delete all orphans user meta in WordPress
DELETE FROM wp_usermeta
WHERE NOT EXISTS (
SELECT * FROM wp_users
WHERE wp_usermeta.user_id = wp_users.ID
)
@danesparza
danesparza / exec.go
Last active June 28, 2023 20:41
Go exec.Command example
package main
import (
"bytes"
"fmt"
"os/exec"
"strings"
)
func main() {