This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_public_ip_address() | |
{ | |
// SOURCE: https://github.com/dotancohen/utility-functions/blob/master/ip-addresses.php | |
$url="simplesniff.com/ip"; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.removeItem = function() { | |
$scope.$storage.notes.splice(document.getElementById('selectedNote').value, 1); | |
document.getElementById('title').value = ''; | |
document.getElementById('content').value = ''; | |
} | |
$scope.addItem = function() { | |
$scope.$storage.notes.push({ | |
"title": "", | |
"content": "" | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select ng-model="savedNote" ng-options="n.title for n in $storage.notes" id="selectedNote"> | |
<option value="">-- Saved Notes --</option> | |
</select> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The module | |
var NotesApp = angular.module('NotesApp', ['ngStorage']); | |
// The controller | |
NotesApp.controller('NotesCtrl', function($scope, $localStorage) { | |
// Set a default | |
$scope.$storage = $localStorage.$default({ | |
"notes": [{ | |
"title": "What is the notes vault?", | |
"content": "It is an AngularJS experiment, done by Joe Steinbring. I think it is fairly cool." |