Skip to content

Instantly share code, notes, and snippets.

@illucent
illucent / 99java
Created February 20, 2014 21:31 — forked from dz0ny/99java
## Setup java
if [ `uname -m` == 'x86_64' ]; then
PATH="/usr/lib64/jvm/java-7-oracle/jre/bin/"
JAVA_HOME="/usr/lib64/jvm/java-7-oracle/"
else
PATH="/usr/lib/jvm/java-7-oracle/jre/bin/"
JAVA_HOME="/usr/lib/jvm/java-7-oracle/"
fi
<?php
/**
* Plugin Name: Static Templates
*
* If most of your site content is in .php template files, and you're tired of
* creating new pages, assigning them page templates, creating page templates
* then doing it all over again on production, this plugin is for you.
*
* Examples:
*
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and PHP-FPM
sudo yum install -y nginx php-fpm
# Install PHP extensions
sudo yum install -y php-devel php-mysql php-pdo \
php-pear php-mbstring php-cli php-odbc \
$ tar zxvf gnatcoll-gpl-2011-src.tgz
$ ./configure --prefix=/usr/gnat/ --disable-projects --disable-pygtk
$ PROCESSORS=4 make
$ make install
$ cd examples
$ make
$ cd gmp/
$ ./isprime
(try a few numbers)
$ cd
<?php
/* Example Usage:
* bt_add_image_size( 'product-screenshot', 300, 300, array( 'left', 'top' ) );
* bt_add_image_size( 'product-feature', 460, 345, array( 'center', 'top' ) );
*/
add_filter( 'intermediate_image_sizes_advanced', 'bt_intermediate_image_sizes_advanced' );
add_filter( 'wp_generate_attachment_metadata', 'bt_generate_attachment_metadata', 10, 2 );
/**
<?php
function thsp_tiny_mce_settings( $tinyMCESettings ) {
return $tinyMCESettings;
/*
This is what $tinyMCESettings array looks like
$tinyMCESettings = Array (
[mode] => exact
[width] => 100%
<?php
/*
* Plugin Name: Feelings
* Plugin URI: trepmal.com
* Description: Add your feelings to your post
* Version: 0.1
* Author: Kailey Lampert
* Author URI: kaileylampert.com
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
//filter the <p> tags from the images and iFrame
function filter_ptags_on_images($content) {
$content = preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
return preg_replace('/<p>\s*(<span .*>)?\s*(<iframe .*>*.<\/iframe>)\s*(<\/span>)?\s*<\/p>/iU', '\1\2\3', $content);
}
add_filter('the_content', 'filter_ptags_on_images');
<?php
//Fix homepage pagination
if ( get_query_var('paged') ) {
$paged = get_query_var('paged');
} else if ( get_query_var('page') ) {
$paged = get_query_var('page');
} else {
$paged = 1;
}
<?php
/**
* Implements custom header styles for Child2013.
* See http://codex.wordpress.org/Custom_Headers
*
* @package WordPress
* @subpackage Twenty_Thirteen
* @since Twenty Thirteen 1.0
*/