Skip to content

Instantly share code, notes, and snippets.

Andy Brudtkuhl abrudtkuhl

Block or report user

Report or block abrudtkuhl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@abrudtkuhl
abrudtkuhl / es.sh
Last active Aug 29, 2015
Install Elastic Search On Ubuntu
View es.sh
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.2.2.deb
sudo dpkg -i elasticsearch-1.2.2.deb
sudo service elasticsearch start
#curl http://localhost:9200
@abrudtkuhl
abrudtkuhl / nginx.conf
Created Jul 19, 2014
NGINX Proxy Config for Elasticsearch Readonly
View nginx.conf
# This config is based @karmi's answer on this Stackoverflow post: http://stackoverflow.com/a/14120342/12442
#
# Run me with:
#
# $ nginx -c path/to/this/file
#
# All requests except GET are denied.
worker_processes 1;
pid nginx.pid;
@abrudtkuhl
abrudtkuhl / global.asax
Last active Aug 29, 2015
ASP.Net MVC Error Handling
View global.asax
protected void Application_Error()
{
var unhandledException = Server.GetLastError();
var httpException = unhandledException as HttpException;
if (httpException == null)
{
var innerException = unhandledException.InnerException;
httpException = innerException as HttpException;
}
@abrudtkuhl
abrudtkuhl / gist:54437529367925aa2bca
Created Aug 8, 2014
Add Already Registered Custom Taxonomy To Custom Post Type
View gist:54437529367925aa2bca
add_action('init','add_categories_to_cpt', 200);
function add_categories_to_cpt(){
register_taxonomy_for_object_type('search_tags', 'post_type');
}
@abrudtkuhl
abrudtkuhl / functions.php
Last active Aug 29, 2015
WordPress Apply new category to all existing posts
View functions.php
add_action( 'init', 'update_taxonomy');
function update_taxonomy() {
$posts = get_posts(
array(
'post_type' => 'post',
'posts_per_page' => -1
)
);
@abrudtkuhl
abrudtkuhl / gist:71c82d4cc3f99032ddce
Created Sep 11, 2014
WordPress Swap All Pages In Custom Taxonomy To Another Category
View gist:71c82d4cc3f99032ddce
add_action( 'init', 'update_taxonomy');
function update_taxonomy() {
$posts = get_posts(
array(
'post_type' => 'page',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'content_category',
@abrudtkuhl
abrudtkuhl / wp-open-files-new-window.js
Last active Aug 29, 2015
jQuery Open Files In New Window
View wp-open-files-new-window.js
// Regex via http://stackoverflow.com/a/6582227/12442
// jQuery Filter idea via http://stackoverflow.com/a/193787/12442
jQuery(function() {
jQuery('a').filter(function() {
return this.href.match(/\.([0-9a-z]+)(?:[\?#]|$)/i);
}).prop('target', '_blank');
});
View .gitignore
# 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
@abrudtkuhl
abrudtkuhl / .gitignore
Created Feb 23, 2012 — forked from redoPop/.gitignore
Template .gitignore file for WordPress projects
View .gitignore
# 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
@abrudtkuhl
abrudtkuhl / responsive-facebook-comments.css
Created Aug 8, 2012
Responsive Facebook Comments CSS
View responsive-facebook-comments.css
/* facebook comments */
.fb-comments, .fb-comments iframe[style], .fb-like-box, .fb-like-box iframe[style] {width: 100% !important;}
.fb-comments span, .fb-comments iframe span[style], .fb-like-box span, .fb-like-box iframe span[style] {width: 100% !important;}
You can’t perform that action at this time.