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>Find Me!</title> | |
</head> | |
<body> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script type="text/javascript"> |
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
<!-- | |
Joe Steinbring | |
http://steinbring.net | |
/////////////////////// | |
This is part 2. To see the original version, check out https://gist.github.com/steinbring/368a9e693c8c765125df. | |
--> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Find Me!</title> |
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
<!-- | |
Joe Steinbring | |
http://steinbring.net | |
--> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> |
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
// Define the unique market cities | |
$scope.marketCities = []; | |
for (var i = 0; i < data.query.results.station.length; i++){ | |
// if it isn't already there, add it | |
if(i !== 0 && data.query.results.station[i].marketCity !== data.query.results.station[i-1].marketCity){ | |
$scope.marketCities.push({ label: data.query.results.station[i].marketCity, stations: [data.query.results.station[i]]}); | |
}else if(i == 0){ | |
$scope.marketCities.push({ label: data.query.results.station[i].marketCity, stations: [data.query.results.station[i]]}); | |
}else if(data.query.results.station[i].id !== data.query.results.station[i-1].id){ | |
// is the market already there? well, just add the station then. |
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
<ul> | |
<li ng-repeat="marketCity in marketCities"> | |
<h2>{{marketCity.label}}</h2> | |
<ul> | |
<li ng-repeat="station in marketCity.stations"> | |
<div class="StationInfo"> | |
<div class="label"> | |
{{station.orgDisplayName}} | |
</div> | |
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." |
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
$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
<?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
<!-- | |
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 |