Skip to content

Instantly share code, notes, and snippets.

Pete Boere peteboere

Block or report user

Report or block peteboere

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
@peteboere
peteboere / named_args.php
Last active Aug 29, 2015
Named arguments in PHP 5.4
View named_args.php
<?php
function named_args($required, $options = [])
{
extract($options + [
'option_one' => false,
'option_two' => true,
'option_three' => 100,
]);
View sass_and_crush_compared.md

Sass/CSS-Crush Comparison

This is an adaptation of the Sass/Less comparison document.

Not a comprehensive overview of features of either library but a comparison of commonalities.

Variables

Sass             | Crush
@peteboere
peteboere / theme_image.php
Last active Apr 13, 2018
Drupal theme overrides for better accessibility
View theme_image.php
<?php
/*
theme_image() override.
*/
function THEME_image($vars)
{
// [Accessibility] Images must always have an alt attribute.
if (! isset($vars['alt'])) {
$vars['alt'] = '';
@peteboere
peteboere / README.md
Created Nov 26, 2012
Avoid console errors in browsers that lack a console.
View README.md
@peteboere
peteboere / svg.bash
Created Aug 8, 2012
Utilities for working with svgs
View svg.bash
#
# Utilities for working with svgs
#
# svg2png - Create png file from source svg using inkscape
# svg2pngr - Create png file from source svg using inkscape recursively
# svgz - Create svgz file from source svg
# svgzr - Create svgz file from source svg recursively
#
View jquery.balanceheights.js
/*
* Equalise the height of boxes (uses min-height).
*/
jQuery.fn.balanceHeights = function() {
// Get max height from list then apply to all.
var heights = [];
this.each( function () {
heights.push(jQuery(this).outerHeight());
});
return this.css('min-height', Math.max.apply({}, heights));
@peteboere
peteboere / dabblet.css
Created Feb 3, 2012 — forked from anonymous/dabblet.css
Watermark background with CSS3 multiple-backgrounds, element() and linear-gradient()
View dabblet.css
/**
* Watermark background with CSS3 multiple-backgrounds, element() and linear-gradient()
*/
h1 {
font:italic 4em Georgia,serif;
text-align:center;
padding: 1em 0 0;
margin:0 0 .3em;
}
@peteboere
peteboere / jquery.alterclass.js
Created Dec 24, 2011
jQuery alterClass plugin: Remove element classes with wildcard matching. Optionally add classes.
View jquery.alterclass.js
/**
* jQuery alterClass plugin
*
* Remove element classes with wildcard matching. Optionally add classes:
* $( '#foo' ).alterClass( 'foo-* bar-*', 'foobar' )
*
* Copyright (c) 2011 Pete Boere (the-echoplex.net)
* Free under terms of the MIT license: http://www.opensource.org/licenses/mit-license.php
*
*/
@peteboere
peteboere / pretty-number.js
Created Nov 25, 2011
Format number with commas
View pretty-number.js
var prettyNumber = function ( number ) {
var number = ( number ).toString(),
point = number.indexOf( '.' ),
floatPart = '',
out = [],
stream;
if ( -1 !== point ) {
floatPart = number.substring( point );
number = number.substring( 0, point );
}
@peteboere
peteboere / up.sh
Created Oct 22, 2011
Bash function for 'cd'ing up the directory tree
View up.sh
#
# Bash function for 'cd'ing up the directory tree
#
# Example use:
# Move working directory up 5 levels
# $> up 5
# Equivalent to
# $> cd ../../../../../
#
You can’t perform that action at this time.