Skip to content

Instantly share code, notes, and snippets.

@dwedwards
dwedwards / Ribbon-over-photo.markdown
Created October 9, 2013 21:21
A Pen by Dave Edwards.
@dwedwards
dwedwards / Index.php
Created June 26, 2013 21:25 — forked from joshhartman/gist:2271523
Weather yahoo api with php
<?php
if(isset($_POST['zipcode']) && is_numeric($_POST['zipcode'])){
$zipcode = $_POST['zipcode'];
}else{
$zipcode = '50644';
}
$result = file_get_contents('http://weather.yahooapis.com/forecastrss?p=' . $zipcode . '&u=f');
$xml = simplexml_load_string($result);
//echo htmlspecialchars($result, ENT_QUOTES, 'UTF-8');
@dwedwards
dwedwards / script.js
Created June 26, 2013 08:48
A simple form validation script in js
// Write your code below!
var userAge = parseInt(prompt("What is your age"), 10); /* parseInt forces the input of the prompt to be parsed through as an integer and 10 rounds it up to a whole number
if (userAge.isNaN){ /* isNaN checks to see whether the input is a number*/
console.log("Not a number");
}
else if(userAge>=18){
console.log("You are over 18");
}