Skip to content

Instantly share code, notes, and snippets.

View ericrasch's full-sized avatar

Eric Rasch ericrasch

View GitHub Profile
@germanny
germanny / _instructions.md
Last active February 16, 2024 16:25 — forked from jimmynotjim/_instructions.md
Instructions for setting up OSX

Setup OSX with a Clean Install

About once a year, my machine gets pretty sluggish and it's time to start fresh. Here's the process I use to update it with everything I need.

TODO: Add info about dotfiles set up and zsh (possible settings file?)

  • Save all dotfiles to a repo for easy transfer
  • Back up all photos, music, apps, iTunes library, keychains, etc.
@jimmynotjim
jimmynotjim / _instructions.md
Last active April 19, 2024 05:26
Setup macOS 12 Monterey

Leaving this for historical reasons, but with the latest iteration I set up proper dotfiles. Check em out

Setup macOS with a Clean Install

After too many years of tinkering my machine is a bit all over. With Mojave High Sierra Montery I wanted to start fresh

1. Run Software Update

Make sure everything is up to date.

@justintadlock
justintadlock / register-post-type.php
Last active October 22, 2023 05:55
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
@germanny
germanny / using-the-seo-plugin-to-the-max.md
Last active July 4, 2017 03:52
Google Plus stuff and PHP constants defined for Facebook Page ID, G+ Author Page, and Twitter Username from Yoast SEO plugin

Constants defined for Facebook Page ID, G+ Author Page, and Twitter Username

Using the Social fields in the SEO Plugin, we don't have to enter this data into the theme too:

/**
* Use Yoast SEO Plugin to create these constants
* http://wordpress.org/plugins/wordpress-seo/
* https://gist.github.com/germanny/6222479
*/
@ericrasch
ericrasch / robots.txt
Last active July 4, 2017 03:52
Robots.txt files for sites with WordPress.
User-agent: *
# Changing the /feed back to include the trailing slash since it otherwise blocks URLs like http://www.thesimpledollar.com/feeding-my-sweet-tooth-without-breaking-my-belly-or-breaking-the-bank/
Disallow: /feed/
Disallow: /cgi-bin
Disallow: /wp-admin
Disallow: /wp-content/cache
Disallow: /wp-includes
Disallow: /trackback
Disallow: /xmlrpc.php

Solid Base .htaccess

Creating a solid base for your .htaccess file. Currently includes RewriteBase, Security (against indexes, files, etc.), and Expires Headers (caching, performance).

  • The URL REWRITES would go at the top of the file.
  • The SECURITY and the WEB PERFORMANCE can go towards the bottom... before and WordPress or WP Super Cache items.
  • UPDATE 2013-08-21: Added code for forcing either non-www or www. on URLs. Also added the MultiViews option.
  • UPDATE 2013-08-23: Added specific code for wp-config.php
  • UPDATE 2013-10-04: Increased favicon expire time.
  • UPDATE 2014-02-05: Removed the Force URL rewrites since there's more than one option.
@germanny
germanny / inc-state-abbreviations.php
Created October 10, 2012 22:41
Responsive States Map. Includes states listing with abbreviations and AI file of the map. Uses both http://archive.plugins.jquery.com/project/maphilight and https://github.com/stowball/jQuery-rwdImageMaps. Requires the latest version of jQuery or you'll b
<?php
switch ($map_state)
{
case 'Alabama':
$abbr = 'AL';
break;
case 'Alaska':
$abbr = 'AK';
break;
@jeremyfelt
jeremyfelt / wp-seo.php
Created October 5, 2012 06:34
Gist description...
add_action( 'init', 'jf_register_my_new_sitemap', 99 );
/**
* On init, run the function that will register our new sitemap as well
* as the function that will be used to generate the XML. This creates an
* action that we can hook into built around the new
* sitemap name - 'wp_seo_do_sitemap_my_new_sitemap'
*/
function jf_register_my_new_sitemap() {
global $wpseo_sitemaps;
$wpseo_sitemaps->register_sitemap( 'my_new_sitemap', 'jf_generate_my_new_sitemap' );
@germanny
germanny / fn-post-custom-fields-infographic.php
Created October 3, 2012 14:21
Infographic standard form
<?php
$ig_post_custom_fields = array (
"infographic" => array(
"name" => "is_infographic",
"std" => "",
"title" => "Is this an infographic post?",
"description" => "If you check this box, we'll add a Pin It share option.",
"type" => "checkbox"),
"image_url" => array(
@jimmynotjim
jimmynotjim / more-mute-regex.md
Created July 19, 2012 14:37 — forked from imathis/tweetbot-mute-regex.md
Tweetbot can use regular expressions to mute tweets in your timeline and mentions.

##Simply annoying Tweets

Annoyingly extended words (4+ of the same letter in a phrase): OOOOHHHHMMMMYYYYGGGGOOOODDDD

([a-z])/1{4}

Tweet w/ just a single hashtag: #omgthissucks

^ *#[^ ]+$