Skip to content

Instantly share code, notes, and snippets.

Avatar

Joe Steinbring steinbring

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am steinbring on github.
  • I am steinbring (https://keybase.io/steinbring) on keybase.
  • I have a public key ASCQ9luTlJukTcAtoD216nLAbUaC17TG-XSy0-tAAXs3yQo

To claim this, I am signing this object:

@steinbring
steinbring / index.html
Created May 31, 2018
Want to do "autocomplete" for doctoral programs in a webform? Using the <datalist> tag, you can use this ...
View index.html
<input list="programs" name="program" size="25">
<datalist id="programs">
<option value="Africology, PhD">
<option value="Anthropology, PhD">
<option value="Architecture, PhD">
<option value="Atmospheric Science, PhD">
<option value="Biological Sciences, PhD">
<option value="Biomedical and Health Informatics, PhD">
<option value="Chemistry, PhD">
@steinbring
steinbring / index.html
Created May 31, 2018
Want to do "autocomplete" for universities in a webform? Using the <datalist> tag, you can use this ...
View index.html
<input list="universities" name="university" size="25">
<datalist id="universities">
<option value="Marquette University">
<option value="University of Wisconsin - Milwaukee">
<option value="University of Wisconsin - Madison">
<option value="University of Wisconsin - La Crosse">
<option value="Concordia University - Wisconsin">
<option value="Medical College of Wisconsin">
<option value="St. Francis Seminary">
@steinbring
steinbring / index.html
Created May 30, 2018
Want to do "autocomplete" for countries in a webform? Using the <datalist> tag, you can use this ...
View index.html
<input list="countries" name="country" size="25" placeholder="country">
<datalist id="countries">
<option value="Afghanistan">
<option value="Åland Islands">
<option value="Albania">
<option value="Algeria">
<option value="American Samoa">
<option value="Andorra">
<option value="Angola">
@steinbring
steinbring / index.html
Created May 30, 2018
Want to do "autocomplete" for states in a webform? Using the <datalist> tag, you can use this ...
View index.html
<input list="states" name="state" size="25" placeholder="state">
<datalist id="states">
<option value="Alabama">
<option value="Alaska">
<option value="Arizona">
<option value="Arkansas">
<option value="California">
<option value="Colorado">
<option value="Connecticut">
@steinbring
steinbring / index.html
Created May 30, 2018
Want to do "autocomplete" for cities in a webform? Using the <datalist> tag, you can use this ...
View index.html
<input list="cities" name="city" size="25" placeholder="city">
<datalist id="cities">
<option value="Aberdeen">
<option value="Abilene">
<option value="Aguada">
<option value="Aguas">
<option value="Aibonito">
<option value="Akron">
<option value="Albany">
@steinbring
steinbring / index.cfm
Created Nov 19, 2015
I stumbled across this the other day. Want to remove null items from a list? Convert it to an array and back again.
View index.cfm
<cfscript>
//A list that includes null items
list = 'Joe,Lisa,,,Beth,John,,,Tom,Liz,Tina,,,,,,,,Omar';
writedump(list);
//Clear out the null items
list = ArrayToList(ListToArray(list));
writedump(list);
</cfscript>
@steinbring
steinbring / index.html
Last active Aug 29, 2015
This shows you how to take the contents of a selected image file and display it on change within the page.
View index.html
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<!-- We are going to display it in an <img> tag, so we will only accept image files -->
<input type='file' accept='images/*' onchange='openFile(event);'>
<div id="TheImageContents">
@steinbring
steinbring / TestCreditCard.php
Last active Aug 29, 2015
This code uses the Luhn formula to validate your credit card number. This acts as error detection, basicly. It could still be a fake number. I wrote this in PHP because the company is doing more PHP and I figure that I could use the practice. :)
View TestCreditCard.php
<?
// What credit card number are we validating?
$CreditCardNumber = '5554172297437101';
// Output the subject
echo $CreditCardNumber;
// Save the credit card number for later
$LastDigit = substr($CreditCardNumber, strlen($CreditCardNumber) - 1);
// Drop the last digit
$CreditCardNumber = substr_replace($CreditCardNumber ,"",-1);
// Reverse the string
@steinbring
steinbring / ResizeImage.php
Last active Aug 29, 2015
No matter what the original width and height is of the source image, this function will resize your source file to a particular width and height of your choosing. The function preserves the original aspect ratio and then just adds solid bars on the top or bottom, if needed.
View ResizeImage.php
<!--
Description: No matter what the original width and height is of the source image, this function will resize your source file to a particular width and height of your choosing. The function preserves the original aspect ratio and then just adds solid bars on the top or bottom, if needed.
Author: Joe Steinbring (http://steinbring.net)
Date: 09/12/2014
-->
<?php
function imageResize($NewWidth, $NewHeight, $NewFilename, $OldFilename) {
// Get the details on the target $OldFilename
You can’t perform that action at this time.