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
var weather = $('#weather'); | |
var city = "Kyiv"; | |
var country = "Ukraine"; | |
var temp; | |
$.ajax({ | |
type: "GET", | |
url: "http://www.webservicex.net//globalweather.asmx/GetWeather?CityName=" + city + "&CountryName=" + country + "", | |
dataType: "xml", | |
success: function (xml) { |
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
<span class="float_right" id="clock" | |
onclick="$('#clock').datepicker('dialog', '', function () {}, {showButtonPanel: true}, [$(window).width() - 209, 27]);"> | |
</span> |
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
//Read more here: http://blog.forecast.io/forecast-embeds/ | |
<div id="dialog-message" title="Current Weather" style="display:none"> | |
<iframe id="forecast_embed" frameborder="0" height="245" style="width:100%" | |
src="http://forecast.io/embed/#lat=50.450100&lon=30.523400&name=Kyiv&units=uk"> | |
</iframe> | |
</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
<div id="clockW"> | |
<iframe id="clockobj" style="border:0;margin:0;padding:0;width:100px;height:100px;" | |
src="http://www.clocktag.com/html5/m121.html"></iframe> | |
<center><p>...</p></center> | |
</div> | |
... | |
<script> | |
... |
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
//to avoid "Uncaught SecurityError: Failed to execute 'replaceState' on 'History'" in Chrome app (local file) | |
//just comment out the following line in jQuery Mobile | |
window.history.replaceState( state, state.title || document.title, href ); | |
//that the bad and ugly solution, but it works:-) | |
//adding "-allow-file-access-from-files" as Chrome command line argument is not a case for me |
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 lang="en"> | |
<head> | |
<title>Comm</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> | |
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> |
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
function rot13(str) { | |
var result=""; | |
var rot=13; | |
var s=(26-rot)%26; //s=rot; if you want to encrypt! | |
for (var i=0;i<str.length;i++) | |
{ | |
var c = str.charCodeAt(i); | |
if (c>=65 && c<=90) | |
result=result+String.fromCharCode((c-65+s)%26+65); | |
else |
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
// ... | |
@Override | |
public void actionPerformed(ActionEvent e) { | |
// TODO implement action body | |
try { | |
URLDisplayer.getDefault().showURL(new URL("http://productivityblog.com.ua")); | |
} catch (MalformedURLException ex) { | |
JOptionPane.showMessageDialog(null, "Can't open an URL: " + ex.getMessage()); | |
} |
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
// Legacy Bing geocoding SOAP services were recent shut down after being replaced by the REST services | |
// so, you need to migrate your app to use the REST services. | |
// | |
// If your application uses .NET you will likely find this library useful: | |
// 'Bing Maps REST Services Toolkit' - https://github.com/Microsoft/BingMapsRESTToolkit | |
// | |
// Just install NuGet package named 'BingMapsRESTToolkit'! | |
// Don't forget to add namespace BingMapsRESTToolkit to your using block! | |
// | |
// Now you can get the coordinates of any address by calling the following method |
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
// found at https://stackoverflow.com/a/32841043 | |
// many thanks to author! | |
window.RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection; | |
// Firefox & Chrome only! This will not work in Edge! | |
var pc = new RTCPeerConnection({iceServers:[]}), noop = function(){}; | |
pc.createDataChannel('');//create a bogus data channel | |
pc.createOffer(pc.setLocalDescription.bind(pc), noop);// create offer and set local description | |
pc.onicecandidate = function(ice) { |
OlderNewer