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 » d13t's snipts The latest snipts from d13t.

showing 1-20 of 32 snipts
  • Getting rid of the 'allowed tags' in Wordpress comment forms.
    <?php comment_form(array('comment_notes_after' => '')); ?>
    

    copy | embed

    0 comments - tagged in  posted by d13t on Aug 16, 2010 at 6:05 a.m. EDT
  • looping through a directory to get a linked list of files
    // This:
    <ol>
    <?
    	$dir = "files/*";  
    	foreach(glob($dir) as $file)  
    	{  
    ?> 
    	<li><p><a href='<?=$file?>'><?=basename($file)?></a></p></li>
    <?
    	} 
    ?>
    </ol>
    
    // Instead of this oldtimer:
    <ol>
    <?
    	function getMap($dir){
    		if (is_dir($dir)){
    			$file = opendir($dir);
    			while (true == ($map = readdir($file))){
    				if ($map!=".."&&$map!=".")
    					$array[] = $map;
    			}
    			closedir($file);
    			return $array;
    		}
    	}
    	if (is_dir("files")){
    	foreach ((array) getMap("files") as $key => $value) {
    	?>
    	<li><p><a href='files/<?=$value?>'><?=$value?></a></p></li>
    	
    <?
    		}
    	}
    ?>
    </ol>
    

    copy | embed

    0 comments - tagged in  posted by d13t on Aug 10, 2010 at 3:40 a.m. EDT
  • kerning type css
    /* kerning and readability improvement in Safari and Chrome */
    html { text-rendering: optimizeLegibility; }
    

    copy | embed

    0 comments - tagged in  posted by d13t on Jun 29, 2010 at 6:02 a.m. EDT
  • smooth operator
    /****SMOOTH OPERATOR********/
    /* Make fonts appear smoother in Safari & Chrome */
    
    html { -webkit-font-smoothing: antialiased; }
    

    copy | embed

    0 comments - tagged in  posted by d13t on Jun 29, 2010 at 6:00 a.m. EDT
  • set device width ipad/iphone
    <meta name="viewport" content="width=device-width,maximum-scale=1.0" />
    

    copy | embed

    0 comments - tagged in  posted by d13t on Jun 29, 2010 at 5:23 a.m. EDT
  • display orientation
    <link rel="stylesheet" media="all and (orientation:portrait)" href="portrait.css">
    <link rel="stylesheet" media="all and (orientation:landscape)" href="landscape.css">
    
    <h1 id="portrait">You're Viewing in Portrait Mode</h1>
    <h1 id="landscape">You're Viewing in Landscape</h1>
    

    copy | embed

    0 comments - tagged in  posted by d13t on Jun 25, 2010 at 2:43 a.m. EDT
  • css target ipad
    <link rel="stylesheet" media="only screen and (max-device-width: 1024px)" href="../ipad.css" type="text/css" />
    

    copy | embed

    0 comments - tagged in  posted by d13t on Jun 25, 2010 at 2:40 a.m. EDT
  • css target iphone 4
    <link rel="stylesheet" media="only screen and (-webkit-min-device-pixel-ratio: 2)" type="text/css" href="../iphone4.css" />
    

    copy | embed

    0 comments - tagged in  posted by d13t on Jun 25, 2010 at 2:39 a.m. EDT
  • MacOS X all processes
    --show all processes except Dashboard
    ps -cm -U username | awk '/:/ && $5!~/Dashboard/'
    

    copy | embed

    0 comments - tagged in  posted by d13t on Apr 28, 2010 at 3:47 a.m. EDT
  • iPhone processes
    ps acmx
    

    copy | embed

    0 comments - tagged in  posted by d13t on Apr 28, 2010 at 3:46 a.m. EDT
  • css opacity for ie6-7 & 8
    //for ie6-7
    
    .see-through {
    filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
    }
    
    // or
    
    .see-through {
    filter: alpha(opacity=80);
    }
    
    
    //for ie8
    
    .see-through {
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
    }
    

    copy | embed

    0 comments - tagged in  posted by d13t on Apr 20, 2010 at 7:31 a.m. EDT
  • open link with javascript
    //open link in new window
    window.open('http://www.google.com/');
    
    //open in current window
    window.location.href='http://www.google.com/';
    

    copy | embed

    0 comments - tagged in  posted by d13t on Mar 24, 2010 at 11:00 a.m. EDT
  • double margin bug fix
    .floatbox {
    	float: left;
    	width: 150px;
    	height: 150px;
    	margin: 5px 0 5px 100px;
    	display: inline;
    }
    

    copy | embed

    0 comments - tagged in  posted by d13t on Mar 19, 2010 at 6:57 a.m. EDT
  • float fixing
    #wrap {
    	margin: 0 auto; /* to align in the middle */
    	width: 960px; /* or whatever you like */
    	overflow: hidden;
    }
    
    #header {
    	display: inline;
    	float: left;
    	position: relative;
    }
    
    
    #navigation {
    	float: left;
    	overflow: hidden; /* for floating lists within the nav */
    	display: inline;
    	position: relative;
    }
    
    #content {
    	clear: both;
    	float: left;
    	display: inline;
    }
    
    #footer {
    	clear: both;
    }
    

    copy | embed

    0 comments - tagged in  posted by d13t on Mar 19, 2010 at 6:51 a.m. EDT
  • getting rid of foreach error
    <?php
    // double any value whose key starts with 'b'
    $arr = array('a'=>1, 'b1'=>2, 'b2'=>3, 'c'=>4, 'd'=>5);
    $non_array = null;
    
    // Normal usage with an array
    print "Test 1:\n";
    foreach ($arr as $key => $val) {
        print "Key $key, Value $val\n";
    
    }
    
    // Normal usage with a non-array (undefined or otherwise empty data set)
    // Outputs: Warning: Invalid argument supplied for foreach() in test.php on line 16
    print "Test 2:\n";
    foreach ($non_array as $key => $val) {
        print "Key $key, Value $val\n";
    }
    
    // By casting the $non_array to an (array) type, it will function without error, skipping the loop
    print "Test 3:\n";
    foreach ((array) $non_array as $key => $val) {
        print "Key $key, Value $val\n";
    }
    
    print "Done.\n";
    
    ?>
    

    copy | embed

    0 comments - tagged in  posted by d13t on Feb 22, 2010 at 4:39 a.m. EST
  • css image hover
    .image {
    /* image properties */
    }
    
    .image:hover {
    -o-transition-duration: .33s;
    -o-transition-property: border, color, opacity, -moz-opacity;
    -webkit-transition-duration: .33s;
    -webkit-transition-property: border, color, opacity, -moz-opacity;
    filter:alpha(opacity=50);
    -moz-opacity:0.5;
    -khtml-opacity: 0.5;
    opacity: 0.5;
    }
    

    copy | embed

    0 comments - tagged in  posted by d13t on Jan 19, 2010 at 7:42 a.m. EST
  • css baseline grid
    body {
    	font-family: Helvetica, Arial, sans-serif;
    	font-size: 13px;
    	line-height: 18px;
    }
    
    p { margin: 0 0 18px 0; }
    

    copy | embed

    0 comments - tagged in  posted by d13t on Nov 16, 2009 at 2:50 a.m. EST
  • get data:image
    <img alt=”logo” src=”data:image/gif;base64,<?php echo base64_encode(file_get_contents("logo.gif")) ?>”>
    

    copy | embed

    0 comments - tagged in  posted by d13t on Sep 30, 2009 at 2:42 a.m. EDT
  • disable Spotlight
    // disable spotlight indexing
    
    sudo mdutil -i off  
    
    // enable spotlight indexing
    
    sudo mdutil -i on
    
    // delete existing spotlight indexes
    sudo mdutil -E 
    
    // some other options:  -s = display status, -v = verbose
    

    copy | embed

    0 comments - tagged in  posted by d13t on Aug 27, 2009 at 3:30 a.m. EDT
  • symbolic link
    #syntax to create symbolic link
    ln -s /export/space/common/archive /archive
    
    #example, link would be created in directory 'placement'
    ln -s /path/to/original/file/or/directory /path/to/the/placement
    
    #dropbox example
    ln -s /Users/username/Dropbox/theFolder /path/to/symbolic/links/directory
    

    copy | embed

    0 comments - tagged in  posted by d13t on Aug 21, 2009 at 8:24 a.m. EDT
Sign up to create your own snipts, or login.