Latest 100 public snipts »
cmoist's
snipts
showing 1-4 of 4 snipts
-
∞ Excel formula to format pricing based on business rules
-- Alter prices to fit business pricing rules -- < .99 - rounds up to .x9 - .39, .99 -- < 9.99 - rounds up to .99 - 7.99, 8.99 -- < 99.99 - rounds up to .49 or .99 - 12.49, 49.99 -- > 100 - rounds down to .00 - 101.00, 459.00 =INT(A1)&IF(A1>=100,".00", IF(A1>=10,IF(RIGHT(A1,2)*1 > 49, ".99", ".49"), IF(A1>=1, ".99", TEXT(ROUNDUP(RIGHT(A1,2)/100,1)-0.01,".00"))))
-
∞ Enable numbering of Google search results
/*Add this to your Firefox user style sheet to see numbers next to each Google search result*/ #gsr #ires ol li {list-style: decimal inside none !important;}
-
∞ Simple CSS error messages with as little html markup as possible.
<!-- Use as shown below. Assumes the use of any 16x16 icons. Larger or smaller may have to adjust line-height and padding. Markup is half the size of my old version, which used nested tags to dictate padding necessary for bg images. Feel free to remove redundant selectors. They are present to ensure this will work stand-alone. --> <style type="text/css"> .error, .confirm { font: normal normal 300 13px/16px Arial, Helvetica, sans-serif; margin: 10px 0; padding: 5px; text-indent: 25px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } .error { background: #FEF1EC url(../assets/images/exclamation_frame.png) no-repeat 8px 5px; border: 1px solid #CD0A0A; color: #CD0A0A; } .confirm { background: #D8FFD3 url(../assets/images/tick_circle_frame.png) no-repeat 8px 5px; border: 1px solid #337C2A; color: #337C2A; } </style> <p class="error">Some error!</p> <p class="confirm">Some confirmation!</p>
-
∞ Generate Title and Meta Tags Function
<?php //Place this in a functions file and use it to generate each //page's title tag and meta data //pass it like this: //titleAndMetaTags("Description","Keywords","Title"); function titleAndMetaTags($description="", $keywords="", $subtitle="") { //variables $standard_title = "Standard Title"; $title_wrapper = "My Site | "; $use_wrapper = true; //true, false...use the standard title wrapper above $name = "Your Name"; $standard_desc = "Description to fall back on"; $standard_keys = "Keywords to fall back on"; //comma separated $index = true; //true = INDEX,FOLLOW, false = NOINDEX,NOFOLLOW !empty($description) ? $meta_desc = $description : $meta_desc = $standard_desc; !empty($keywords) ? $meta_keys = $keywords : $meta_keys = $standard_keys; if ($use_wrapper) { !empty($subtitle) ? $title = $title_wrapper . $subtitle : $title = $standard_title; } else { !empty($subtitle) ? $title = $subtitle : $title = $standard_title; } echo "<title>" . $title . "</title>\n"; echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"/>\n"; echo "<meta name=\"description\" content=\"" . $meta_desc . "\">\n"; echo "<meta name=\"keywords\" content=\"" . $meta_keys . "\">\n"; echo "<meta name=\"robots\" content=\""; if ($index) {echo "INDEX,FOLLOW";} else {echo "NOINDEX,NOFOLLOW";} echo "\">\n"; echo "<meta name=\"author\" content=\"" . $name . "\">\n"; echo "<meta name=\"copyright\" content=\"©" . date('Y') . " " . $name . "\">\n"; echo "<meta name=\"designer\" content=\"" . $name . "\">\n"; } ?>


