Skip to content

Instantly share code, notes, and snippets.

View adamwalter's full-sized avatar

Adam Walter adamwalter

View GitHub Profile
@adamwalter
adamwalter / add-wordpress-settings-page.php
Created May 28, 2020 16:21 — forked from DavidWells/add-wordpress-settings-page.php
WordPress :: Add Settings Page with All Fields
<?php
/*
Plugin Name: Homepage Settings for BigBang
Plugin URI: http://www.inboundnow.com/
Description: Adds additional functionality to the big bang theme.
Author: David Wells
Author URI: http://www.inboundnow.com
*/
// Specify Hooks/Filters
@adamwalter
adamwalter / wp-upgrade-plugins.sh
Last active November 29, 2018 16:10 — forked from stevegrunwell/gist:11c3e9d370127fa97898
Bulk-upgrade WordPress plugins using WP-CLI, committing each upgrade to Git as we go
#! /bin/bash
# Find available updates for WordPress plugins via WP-CLI, then upgrade theme one at a time.
# After each upgrade, commit the changed files to Git.
#
# Requires that WP-CLI be installed and in your path: http://wp-cli.org/
#
# Currently, it will only work when run from the root of the WordPress installation, and has
# a hard-coded path for wp-content/plugins.
#
@adamwalter
adamwalter / ask.sh
Created April 1, 2016 15:27
Bash: General-purpose Yes/No prompt function ("ask")
# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.
ask() {
# http://djm.me/ask
while true; do
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
@adamwalter
adamwalter / github_repos.rb
Last active March 16, 2016 16:22 — forked from c10b10/github_repos.rb
Clones all the private github repos from a certain organization, including branches, submodules and wiki
#!/usr/bin/env ruby
require "json";
# Change github credentials and organization name
github = {:user => "johndoe", :pass => "password", :org => "twitter"}
repos = `curl --user "#{github[:user]}:#{github[:pass]}" https://api.github.com/orgs/#{github[:org]}/repos\?per_page\=200\&type\=private`
for repo in JSON.load(repos)
puts "\n+++ Starting with " + repo["name"]
%x[git clone #{repo["ssh_url"]}]
@adamwalter
adamwalter / gf-acf-image-attachment-maker.php
Last active September 12, 2015 21:02 — forked from adamplabarge/gf-acf-image-attachment-maker.php
GF-ACF image attachment maker
<?php
/**
* Change the default GF upload path
* https://www.gravityhelp.com/documentation/article/gform_upload_path/
*/
function agw_change_upload_path($path_info, $form_id){
$wp_upload_path = wp_upload_dir();
$path_info["path"] = $wp_upload_path['path'] . '/';
$path_info["url"] = $wp_upload_path['url'] . '/';
@adamwalter
adamwalter / .jshintrc
Last active August 29, 2015 14:26 — forked from sdempsey/.jshintrc
my .jshintrc
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope