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
| $.fn.SimplePoll('/api/tiramisu/v1/tick') | |
| .progress(function(line) { | |
| var parts = line.split(";") | |
| $('#bar').css('width', parts[0]+'%'); | |
| $('#progress').html(parts[1]); | |
| }) | |
| .then(function() { | |
| $('#progress').html("Ferdig nå."); | |
| }); |
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 xhr = function (url, options) { | |
| options = options || {}; | |
| var req = new XMLHttpRequest(), | |
| method = options.method || 'get', | |
| dfd = new $.Deferred(); | |
| req.open(method, url, true); | |
| req.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); |
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
| #!/usr/bin/ruby | |
| require 'net/http' | |
| file_name = '/tmp/rolfstangen-webcam.jpg' | |
| Net::HTTP.start("www.rolfstangen.no") do |http| | |
| resp = http.get("/webcam/cam_1.jpg") | |
| open(file_name, 'wb') do |file| | |
| file.write(resp.body) | |
| end |
NewerOlder