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

showing 1-16 of 16 snipts
  • JSP & HTML5 template
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
    xmlns="http://www.w3.org/1999/xhtml"
    version="2.0">
    <jsp:directive.page contentType="text/html" pageEncoding="UTF-8"/>
    
    <![CDATA[<!DOCTYPE html>]]>
    <html lang="de">
        <head>
            <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
            <title>Neopay Init-Antwort</title>
            <link rel="stylesheet" type="text/css" href="http://www.blueprintcss.org/blueprint/src/typography.css"/>
            <link rel="stylesheet" type="text/css" href="http://www.blueprintcss.org/blueprint/src/forms.css"/>
            <link rel="stylesheet" type="text/css" href="http://www.blueprintcss.org/blueprint/src/grid.css"/>
        </head>
    
        <body>
            <div class="container">
    
            </div>
    
        </body>
    </html>
    
    </jsp:root>
    

    copy | embed

    0 comments - tagged in  posted by lenni on May 31, 2010 at 10:45 a.m. EDT
  • JSP Page template
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
    					xmlns:c="http://java.sun.com/jsp/jstl/core"
    					xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
    					xmlns:jb="http://www.mytoys.de/jbacca"
    					xmlns="http://www.w3.org/1999/xhtml"
    					version="2.0">
    	<jsp:directive.page contentType="text/html" pageEncoding="UTF-8"/>
    
    	<script text="text/javascript">
    		window.open('schritt1.jsp','mywin',
    		'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');
    	</script>
    
    </jsp:root>
    

    copy | embed

    0 comments - tagged in  posted by lenni on May 07, 2010 at 6:20 a.m. EDT
  • Installing setuptools
    ./python -c "import urllib; urllib.main()" \ http://peak.telecommunity.com/dist/ez_setup.py \ | ./python - -U setuptools
    

    copy | embed

    0 comments - tagged in  posted by lenni on Apr 08, 2010 at 6:41 p.m. EDT
  • Getting a logger with Log4j
    private static final Log LOG = LogFactory.getLog(SomeClassName.class);
    

    copy | embed

    0 comments - tagged in  posted by lenni on Feb 09, 2010 at 4:43 a.m. EST
  • tar cheat sheet
    #extract tar file (uncompressd)
    tar xf filename.tar
    
    #extract gzip'ed tar file (tar.gz)
    tar xvfz filename.tar.gz
    
    #extract tar into specified folder
    tar -xf compassindex-201004131433.tar -C 201004131433/
    
    #compress a directory into a tar.gz
    tar -pczf stoffbruch.tar.gz stoffbruch/
    
    #extract a .bz2
    bunzip2 konsum-error.log.2010-07-31.bz2
    

    copy | embed

    0 comments - tagged in  posted by lenni on Jan 22, 2010 at 6:53 a.m. EST
  • Running a class inside a jar
     java -cp konsumtools.jar de.myToys.konsum.tools.export.Sitemapper
    

    copy | embed

    0 comments - tagged in  posted by lenni on Jan 22, 2010 at 5:33 a.m. EST
  • ack examples
    ack cancelcode --jsp --ignore-dir=target
    ack \<script --jsp --ignore-dir=target
    ack \<script --jsp --ignore-dir=target --ignore-dir=jsp --ignore-dir=mtstat
    

    copy | embed

    0 comments - tagged in  posted by lenni on Jan 20, 2010 at 4:19 a.m. EST
  • JSP if-else
    <c:choose>
      <c:when test='${param.p == "someValue"}'>	
      </c:when>
      
      <c:otherwise> 	
      </c:otherwise>
    </c:choose>
    

    copy | embed

    0 comments - tagged in  posted by lenni on Jan 19, 2010 at 9:42 a.m. EST
  • Print a file line for line in Java (the 1.6 way)
    import java.io.BufferedReader;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    public class SlugTester {
        static String FILENAME = "C:\\slug-test.txt";
        public static void main(String[] args)  {
    
            try  {
                BufferedReader reader = new BufferedReader(new FileReader(FILENAME));
                String line;
                while ((line = reader.readLine()) != null)  {
                    System.out.println(line);
                }
            }
    
            catch (FileNotFoundException e)  {
                e.printStackTrace();
            }
            catch (IOException e)  {
                e.printStackTrace();
            }
        }
    }
    

    copy | embed

    0 comments - tagged in  posted by lenni on Jan 12, 2010 at 4:03 a.m. EST
  • Java regex tester
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    
    public class RegexTester {
    
        /**
         * @param args
         */
        public static void main(String[] args) {
    	// TODO Auto-generated method stub
    
    	String regex = "/ajax/\\w+/(.*)";
    
    	String[] strings = { "/ajax/hello/KID/de-mt.vc.ca02.06.04/1559286",
    		"/ajax/hell_o/KID/de-mt.vc.ca02.06.04/1559286",
    		"/ajax/h0e-l8l_o/KID/de-mt.vc.ca02.06.04/1559286", };
    
    	for (String s : strings) {
    	    Pattern pattern = Pattern.compile(regex);
    	    Matcher matcher = pattern.matcher(s);
    
    	    String kid = "";
    	    if (matcher.find()) {
    		// group(0) returns the entire match, not a captured group
    		kid = matcher.group(1);
    	    }
    
    	    System.out.println(kid);
    	}
        }
    }
    

    copy | embed

    0 comments - tagged in  posted by lenni on Dec 28, 2009 at 4:23 a.m. EST
  • jQuery HTML template
    <!DOCTYPE html>
    
    <html lang="en">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <title>Lektion 7</title>
        <link rel="stylesheet" type="text/css" href="style.css" />
        
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
        
        <script type="text/javascript">
                $(document).ready(function(){
                
                
                });
                
        </script>
    </head>
    
    <body>
        <h1 id="ueberschrift"></h1>    
    </body>
    </html>
    

    copy | embed

    0 comments - tagged in  posted by lenni on Dec 15, 2009 at 6:21 a.m. EST
  • Protoype HTML Page template
    <!DOCTYPE html>
    
    <html lang="en">
    <head>
    	<meta http-equiv="content-type" content="text/html; charset=utf-8">
    	<title>Lektion 7</title>
    	<link rel="stylesheet" type="text/css" href="style.css" />
    	
    	<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js" type="text/javascript"></script>
    	
    	<script type="text/javascript">
    			
    			var callback = function(event){
    				var clickedElement = event.element();
    				var styleObj = {
    					color:"red"
    				};
    				clickedElement.setStyle(styleObj);
    			};
    			
    			var el=$("ueberschrift");
    			el.observe("click", callback);
    	</script>
    </head>
    
    <body>
        <h1 id="ueberschrift">Lektion 8: Callbacks mit Prototype</h1>	
    </body>
    </html>
    

    copy | embed

    0 comments - tagged in  posted by lenni on Dec 11, 2009 at 5:46 a.m. EST
  • .hgignore & .gitignore template
    syntax: glob
    
    # build directories and files
    **/build/*
    build/*
    target/**.* #hg syntax
    target #git syntax
    dist/**.*
    *.pyc
    
    
    #Eclipse
    .settings/*.**
    .classpath
    .project
    
    # Netbeans
    nb-configuration.xml
    nbactions.xml
    
    # Backup files left behind by the Emacs editor.
    *~
    # Lock files used by the Emacs editor.
    .\#*
    # Temporary files used by the vim editor.
    .*.swp
    # Temporary files used by TestMate
    ._*
    # XCode user data
    **.pbxuser
    **.mode?v?
    **.perspectivev?
    # documentation
    **.docset/*
    # for those crazies using svn and hg at the same time
    *.svn*
    
    # Random OS stuff
    .DS_Store
    Thumbs.db
    
    # temporary folders
    syntax: regexp
    .*/te?mp/.*
    

    copy | embed

    0 comments - tagged in  posted by lenni on Dec 11, 2009 at 4:32 a.m. EST
  • Prototype & Scriptacolous template
    <!DOCTYPE html>
    
    <html lang="en">
    <head>
    	<meta http-equiv="content-type" content="text/html; charset=utf-8">
    	<title>Title Goes Here</title>
    	<link rel="stylesheet" type="text/css" href="style.css" />
    	<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js" type="text/javascript"></script>
    	<script src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.2/scriptaculous.js" type="text/javascript"></script>
    </head>
    
    <body>
        <p>This is my web page</p>
    </body>
    
    </html>
    

    copy | embed

    0 comments - tagged in  posted by lenni on Dec 01, 2009 at 9:21 a.m. EST
  • HTML5 template
    <!DOCTYPE html>
    
    <html lang="en">
    <head>
    	<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    	<title>Title Goes Here</title>
    	<link rel="stylesheet" type="text/css" href="style.css" />
    </head>
    
    <body>
        <p>This is my web page</p>
    </body>
    
    </html>
    

    copy | embed

    0 comments - tagged in  posted by lenni on Dec 01, 2009 at 8:19 a.m. EST
  • jsp jbacca template
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
    					xmlns:c="http://java.sun.com/jsp/jstl/core"
    					xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
    					xmlns:jb="http://www.mytoys.de/jbacca"
    					xmlns="http://www.w3.org/1999/xhtml"
    					version="2.0">
    
    	<jsp:directive.tag body-content="scriptless"
    										 description="Lädt den Inhalt einer URL herunter und fügt sie in die Seite ein."
    										 example=""/>
    
    	<jsp:directive.attribute
            description="Die URL die in das Ajax-Fenster geladen werden soll."
            name="href" required="false" />
    
    	<jb:generateId />
    
    	<jb:script>
    		new KONSUM.jbacca.ImageZoom("${jbaccaId}");
    	</jb:script>
    
    </jsp:root>
    

    copy | embed

    0 comments - tagged in  posted by lenni on Dec 01, 2009 at 4:36 a.m. EST
Sign up to create your own snipts, or login.