IMPORTANT!

Snipt is going open source. We've toyed with this idea for quite a while, and have finally decided it's the right way to move forward.

A few things:
  • The entire Snipt source code will be released on GitHub under the 3-clause BSD License on Friday, September 10th.
  • While we'd like to think we're perfect, we realize we're only human. By open sourcing the software that runs this website, certain bugs or security flaws may be discovered that could compromise the privacy of your snipts.
  • Only the Lion Burger team will be able to push commits to the Snipt.net site. Contributors should send a pull request to add new features or submit patches.
  • By using this site, you agree not to be too angry or take any legal action against Lion Burger should this whole thing go up in flames some day.
  • Follow us on Twitter for updates.
I agree, close this message
Sign up to create your own snipts, or login.

Latest 100 public snipts » cmoist's snipts The latest snipts from cmoist.

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"))))
    

    copy | embed

    0 comments - tagged in  posted by cmoist on Jun 09, 2010 at 1:53 p.m. EDT
  • 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;}
    

    copy | embed

    1 comment - tagged in  posted by cmoist on Jun 08, 2010 at 11:18 a.m. EDT
  • 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>
    

    copy | embed

    0 comments - tagged in  posted by cmoist on Aug 13, 2009 at 4:02 p.m. EDT
  • 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=\"&copy;" . date('Y') . " " . $name . "\">\n";
    	echo "<meta name=\"designer\" content=\"" . $name . "\">\n";
    }
    
    ?>
    

    copy | embed

    0 comments - tagged in  posted by cmoist on Jul 31, 2009 at 3:37 p.m. EDT
Sign up to create your own snipts, or login.