Skip to content

Instantly share code, notes, and snippets.

View joshuapowell's full-sized avatar
☄️
https://info.cern.ch/hypertext/

J.I. Powell joshuapowell

☄️
https://info.cern.ch/hypertext/
View GitHub Profile
@joshuapowell
joshuapowell / gist:1345339
Created November 7, 2011 15:55
Convert a string (e.g., News & Events) to a usable CSS selector (e.g., id="news-events", class="news-events").
<?php
/**
* Convert a string (e.g., News &amp; Events) into a usable
* CSS selector (e.g., id="news-events", class="news-events").
*
* @param $text
* @return $text
*/
function check_selector($text) {
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="description" content="" />
<title></title>
<!-- Flash player dependant upon WP Audio Player by Martin Laine -->
<!--[if lt IE9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
@joshuapowell
joshuapowell / HTML5 Stub
Created April 12, 2011 04:53
A generic & empty HTML5 page structure.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="author" content="" />
<meta name="copyright" content="" />
<meta name="robots" content="index, follow" />
@joshuapowell
joshuapowell / Drupal Display Array
Created April 12, 2011 02:04
Display an array in a readable format, preserving the whitespace, formatting as code, and displaying inside of a Message box.
<?php
/**
* Display an array in a readable format, preserving the whitespace,
* formatting as code, and displaying inside of a Message box. This can
* be placed inside of any function within a Drupal module or theme.
* This is primarily used during troubleshooting and should never be
* used on a production website.
*
* @param $array
@joshuapowell
joshuapowell / PHP IS_NUMBER
Created April 12, 2011 02:01
Check if a value is a number, if it is print it out and keep going, other wise return FALSE
<?php
/**
* Check if a value is a number, if it is print it out and keep going, other wise return FALSE
*
* @param (string) $number
* @return (mixed) boolean/$number
*/
function is_number($number) {