Skip to content

Instantly share code, notes, and snippets.

View oomlaut's full-sized avatar

Paul Gueller oomlaut

  • Milwaukee, WI
View GitHub Profile
@oomlaut
oomlaut / dynamicselect.html
Last active August 29, 2015 13:56
dynamicselect_ui
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Web Project</title>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="dynamicselect.js"></script>
</head>
<body>
@oomlaut
oomlaut / fixednsap.css
Created February 10, 2014 19:25
fixedsnap_ui
#container{
width:960px;
margin:0 auto;
}
header{
width:100%;
height:200px;
background-color:#ccc;
}
section#main{
@oomlaut
oomlaut / SHA-1.js
Created October 23, 2014 19:57
SHA-1 implementation in JavaScript
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* SHA-1 implementation in JavaScript (c) Chris Veness 2002-2014 */
/* */
/* - see http://csrc.nist.gov/groups/ST/toolkit/secure_hashing.html */
/* http://csrc.nist.gov/groups/ST/toolkit/examples.html */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* jshint node:true *//* global define, escape, unescape */
'use strict';
@oomlaut
oomlaut / generatesitemap.php
Last active August 29, 2015 14:20
Generate sitemap.xml formatted file from text file containing list of links
<?php
print("\n");
if(!isset($argv[1]))
{
die("! Required argument: filename \n");
}
$filename = $argv[1];
@oomlaut
oomlaut / parseQuerystring.jquery.js
Created July 23, 2011 15:14
Parse the querystring with jQuery, returning an object containing index/value pairs
jQuery.extend({
parseQuerystring: function(){
var nvpair = {};
var qs = window.location.search.replace('?', '');
var pairs = qs.split('&');
$.each(pairs, function(i, v){
var pair = v.split('=');
nvpair[pair[0]] = pair[1];
});
return nvpair;
@oomlaut
oomlaut / Markup.html
Created August 9, 2012 03:04
Basic Accordion UI Element
<dl class="accordion">
<dt>Accordion Heading 1</dt>
<dd>
<p>Some content</p></dd>
<dt>Accordion Heading 2</dt>
<dd>
<p>Some more content</p></dd>
<dt>Accordion Heading 3</dt>
<dd>
<p>Some final content</p></dd>
@oomlaut
oomlaut / BasicTabContent.jQuery.js
Created August 11, 2012 04:38
Basic Tabbed Content UI Element
if (typeof jQuery != "undefined") {
(function($) {
$('.accordion dt').each(function() {
$(this).on('click', function(){
$(this).toggleClass('on').siblings('.on').removeClass('on').end()
.next('dd').slideToggle().siblings('dd').slideUp();
}).next('dd').hide();
});
})(jQuery);
}​
@oomlaut
oomlaut / listcolumnize.jquery.js
Created May 10, 2013 16:31
Columnize a list using jQuery
(function($){
$('ul').each(function() {
var $lis = $('li', this);
cols = [],
colNum= 4,
colLength = Math.ceil($lis.length / colNum),
$newList = $('#columnify');
for(var i = 0; i < colLength; i++){
cols.push($('<ul>').appendTo($newList));
}
@oomlaut
oomlaut / batters.php
Created May 10, 2013 16:28
Example of screen-scraping in PHP
<?
//include('dbconfig.inc.php');
//include('db.class.php');
//include('simplehtmldom/simple_html_dom.php');
$availableTeams = array("ARI","ATL","BAL","BOS","CIN","CHC","CHW","CLE","COL","DET","FLA","HOU","KCR","LAA","LAD","MIL","MIN","NYM","NYY","OAK","PHI","PIT","SD","SF","SEA","STL","TB","TEX","TOR","WSN");
foreach($availableTeams as $availableTeam)
{?>
<a href='batters.php?team=<?=$availableTeam?>'><?=$availableTeam?></a> |
<?}?>
@oomlaut
oomlaut / jquery.push-slider.js
Created May 10, 2013 16:30
Push slider (rejected work for client UI)
(function ($) {
/**
*
*/
$.fn.pushSlider = function (options, callback) {
var settings = {
initialSlide: 0,
duration: 840
};
$.extend(true, settings, options);