Skip to content

Instantly share code, notes, and snippets.

View benklocek's full-sized avatar

Ben Klocek benklocek

View GitHub Profile
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices (57x57): -->
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png">
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≤ 6: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png">
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≥ 7: -->
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="apple-touch-icon-76x76-precomposed.png">
<!-- For iPhone with high-resolution Retina display running iOS ≤ 6: -->

Web Design Contract (open-source)

Between [your name] and [their name]

Summary:

You ([their name]), located at [customer address] are hiring me ([your name]) located at [company address] to [design and develop a web site] for the estimated total price of [total] as outlined in our previous correspondence.

What do both parties agree to do?

// For 403 @ /admin/settings/customerror
// Title: Access Denied
<?php global $user; // http://www.kinetasystems.com/blog/creating-custom-error-pages-in-drupal ?>
<?php if ($user->uid): ?>
<p>Sorry <?php print $user->name; ?>, you don't have permission to view the page you've just tried to access.</p>
<p>If you feel that you have received this message in error, please
<a href="/about">contact us</a> with specific details so that we may review your access to this web site.</p>
<p>Thanks</p>
<?php else: ?>
<p>This page may be available to clients and registered users only. Please select from one of the other options available to you below.</p>
# 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
@benklocek
benklocek / include-regex.php
Created May 30, 2011 20:11
Regex for fixing absolute URL includes
$pattern = '<\?(\s?include\("?)(http:\/\/www\.domain\.com)(.*?\.php)(.*\n?)';
$subject = "<?php include($_SERVER['DOCUMENT_ROOT'] . '$3';) ?>";
@benklocek
benklocek / gist:4062437
Created November 12, 2012 22:30
Wordpress Functions: Add Style Dropdown to TinyMCE
// Add the Style Dropdown Menu to the second row of visual editor buttons
function bracia_mce_buttons_2($buttons){
array_unshift($buttons, 'styleselect');
return $buttons;
}
add_filter('mce_buttons_2', 'bracia_mce_buttons_2');
function bracia_tiny_mce_before_init( $settings ) {
$style_formats = array(
// array(
@benklocek
benklocek / gist:4062466
Created November 12, 2012 22:32
Wordpress Functions: CSS Selector for Page as parent of custom post type
//current page filter to shop section
function bracia_add_class_to_wp_nav_menu($classes){
switch (get_post_type()){
case 'course':
// we're viewing a custom post type, so remove the 'current_page_xxx and current-menu-item' from all menu items.
$classes = array_filter($classes, "bracia_remove_parent_classes");
// add the current page class to a specific menu item (replace ###).
if (in_array('menu-item-44', $classes)){
$classes[] = 'current_page_parent';
@benklocek
benklocek / gist:4062520
Created November 12, 2012 22:39
Wordpress Functions: Custom Login Logo
// custom admin login logo for child theme * Don't forget /img/custom-login-logo.png :)
function bracia_custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image: url('.get_bloginfo('stylesheet_directory').'/img/custom-login-logo.png) !important; }
</style>';
}
add_action('login_head', 'bracia_custom_login_logo', 11);
@benklocek
benklocek / gist:4062506
Created November 12, 2012 22:36
Wordpress Functions: Woo Site Copyright Override
//Override woocanvas copyright message on left footer
function bracia_woo_shortcode_site_copyright() {
return $output = sprintf( '%1$s%3$s %4$s %5$s%6$s %2$s', $atts['before'], $atts['after'], "&copy; " . date( 'Y' ), get_bloginfo( 'name' ) . '. <a href="/terms-conditions/">', __( 'All Rights Reserved', 'woothemes' ), '</a>.' );
}
add_filter('woo_shortcode_site_copyright', 'bracia_woo_shortcode_site_copyright', 2);
@benklocek
benklocek / gist:4062489
Created November 12, 2012 22:34
Wordpress Functions: Adjust JPEG filter quality
//set image quality higher
function filter_image_quality() { return 100; }
add_filter('wp_editor_set_quality','filter_image_quality');