Skip to content

Instantly share code, notes, and snippets.

@JGrubb
JGrubb / div-replacer.js
Created February 22, 2010 05:50
My little pony's first jQuery // switching some divs out
<script type="text/javascript">
$('#one-click').click(function() {
$('.two')
.fadeOut(1000, function() {
$('.one')
.fadeIn(1000);
});
});
$('#two-click').click(function() {
@JGrubb
JGrubb / copyright_year.php
Created February 23, 2010 16:31
returns current year for use in copyright footer
//CSS - .commercial:hidden;
//to begin with. I can't say this degrades so well, but hopefully no one will ever know.
//Basically trying to implement on one page what should be done on two, but couldn't get anyone to bite
//on just doing one page, for some reason.
//One page - Residential, and another Commercial. Swaps the two with a nice fade.
<script type="text/javascript">
$('.buttons a').first().addClass('active');
/*
Should you stumble across this, I found it here- http://drupal.org/node/15958#comment-47684
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<div id="image-wrapper"><img src="<?php bloginfo ('url'); ?>/images/<?php
$str = the_title_attribute('echo=0');
$str = strtolower($str);
echo $str; ?>.jpg" /></div>
<!--this is the convoluted way that you have to wrap a wordpress function in order to get it to output the proper value for strtolower to operate on-->
validates_format_of :email,
:with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i,
:message => 'email must be valid'
<%= t = Time.now
t.strftime("%Y") %>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="1000"
height="298">
<param name="movie" value="FILENAME.swf">
<param name="quality" value="high">
<embed src="FILENAME.swf" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="1000"
height="298"></embed>
</object>
<?php
// Quite far from bombproof, this script tries to shorten
// the task of fixing UPPERCASE WEBSITE COPY.
// It can only split sentences by periods at this time.
// Oh, and remove the period at the end of the last sentence.
$str = "MANY POTENTIAL CLIENTS LOOK TO OUR NETWORK OF ATTORNEY FOR HELP DURING THESE TROUBLING TIMES. INCREASE YOUR FIRMS BANKRUPTCY FILINGS BE WORKING WITH MOTIVATED CLIENTS LOOKING FOR ANSWERS THAT ONLY YOU CAN PROVIDE";
$str = strtolower($str);
$array = explode(".", $str);
@JGrubb
JGrubb / css_drop_shadows.html
Created May 7, 2011 19:35
CSS Drop shadows
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Demo: CSS drop-shadows without images &#8211; Nicolas Gallagher</title>
<meta name="description" content="Using CSS pseudo-elements, box-shadows, and transforms to create drop-shadow effects without images from semantic HTML">
<link rel="canonical" href="/css-drop-shadows-without-images/demo/">
<style>
body {