Code Snippets Ctrl+C, Ctrl+V...

Hello World

Basic Bash

A very basic script to say Hello to the world.

							
#!/bin/bash        
STR="Hello World!"
echo $STR
							
						

The same script once again, this time to say goodbye!

							
#!/bin/bash        
STR="Goodbye World!"
echo $STR
							
						

Simple Element Filtering

Javascript JQuery

This Javascript controls the search box filtering on the current page. On input the JQuery checks the search box against the header. If theres a match, the element fades in. Otherwise the element fades out.

							
$('#searchBox').on('input',function(e){
    searchText = $(this).val().toLowerCase();
    $( ".scriptRow" ).each(function( index ) {
        headerText = $(this).find(".rowHeader h2").text().toLowerCase();
        if(headerText.indexOf(searchText) > -1){
            $(this).fadeIn("Fast");
        } else  {
            $(this).fadeOut("Fast");
        }
    });
});