This file contains hidden or 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
| navigator.geolocation.getCurrentPosition(function(result) { | |
| var location = data.coords; | |
| }); |
This file contains hidden or 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
| var calculateDistance = function(location1, location2) { | |
| // this is where we want to calculate the distance from. You can of course split this out so that the function | |
| var origin = {longitude:50,latitude:1}; | |
| // first calculate the locations into radians. | |
| var radlat1 = Math.PI * location1.latitude/180; | |
| var radlat2 = Math.PI * location2.latitude/180; | |
| var radlon1 = Math.PI * location1.longitude/180; | |
| var radlon2 = Math.PI * location2.longitude/180; | |
| var theta = location2.longitude-location1.latitude; |
This file contains hidden or 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
| var country = "UK"; | |
| // fetch results from yql | |
| var url = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20location%20in%20(select%20id%20from%20weather.search%20where%20query%20%3D%20%22"+country+"%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=?"; | |
| $.getJSON(url, function(data) { | |
| var sunData = {} | |
| // if there are results | |
| if (data.query.results.channel.length > 0) { | |
| var result = data.query.results.channel[0]; |
This file contains hidden or 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
| <script src="http://j.maxmind.com/app/country.js"></script> | |
| <script> | |
| var country = geoip_country_name(); | |
| </script> |
This file contains hidden or 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
| navigator.geolocation.getCurrentPosition(function(result) { | |
| var location = data.coords; | |
| // This now consists of: | |
| // latitude | |
| // longitude | |
| // altitude (if avaiable) | |
| // various other attributes | |
This file contains hidden or 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 | |
| $to = "+447515354472"; | |
| ?> | |
| <Response> | |
| <Sms to="<?php echo $to;?>" from="<?php echo $_POST['From'];?>"><?php echo $_POST['Body']; ?></Sms> | |
| </Response> |
This file contains hidden or 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
| var reply = "https://twitter.com/intent/tweet?in_reply_to="+tweet.id; | |
| var retweet = "https://twitter.com/intent/retweet?tweet_id="+tweet.id; | |
| var star = "https://twitter.com/intent/favourite?tweet_id="+tweet.id; |
This file contains hidden or 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
| function addTwitterBSRegs(id) { | |
| var html = "<a class='reply' target='_blank' href='https://twitter.com/intent/tweet?in_reply_to="+id+"'>reply</a>"; | |
| html += "<a class='retweet' target='_blank' href='https://twitter.com/intent/retweet?tweet_id="+id+"'>retweet</a>"; | |
| html += "<a class='star' target='_blank' href='https://twitter.com/intent/favourite?tweet_id="+id+"'>star</a>"; | |
| html += "<a class='twitter' target='_blank' href='https://twitter.com/'>twitter</a>"; | |
| return html; | |
| } |
This file contains hidden or 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
| <!-- | |
| /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ | |
| \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ | |
| /\/\ WMAS woz 'ere \/\/ Client Name Here \/\/ | |
| \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ | |
| /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ | |
| --> |
This file contains hidden or 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 | |
| // include the twilio php help library | |
| require "Services/Twilio.php"; | |
| // Setup your credentials | |
| $account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; | |
| $auth_token = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"; | |
| // Step 3: instantiate a new Twilio Rest Client |