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
| module.exports = exports = { | |
| create : function(notCachedClient){ | |
| var cachedClient = {}; | |
| var cache = {}; | |
| Object.keys(notCachedClient).forEach(function(method){ | |
| cachedClient[method] = function(){ | |
| var args = Array.prototype.slice.call(arguments), | |
| cb = args.pop(); |
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
| processor : 0 | |
| vendor_id : GenuineIntel | |
| cpu family : 6 | |
| model : 26 | |
| model name : Intel(R) Xeon(R) CPU L5520 @ 2.27GHz | |
| stepping : 5 | |
| microcode : 0x16 | |
| cpu MHz : 2266.747 | |
| cache size : 8192 KB | |
| physical id : 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
| <html> | |
| <head> | |
| <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> | |
| <script> | |
| (function($, window, document){ | |
| $(document).ready(function(){ | |
| $(window).blur(function(){ | |
| $('h1').text("Cambio il titolo al blur"); | |
| }); |
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 os_type = Titanium.Platform.getOsname() == 'android'?'android':'ios'; | |
| var xhr = Titanium.Network.createHTTPClient(); | |
| var getNotCached = function(url){ | |
| var timestamp = new Date().getTime(); | |
| if (url.indexOf('?') == -1) { | |
| return url + '?nocache=' + timestamp ; | |
| } | |
| return url + '&nocache=' + timestamp ; |
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 getAuthString = function(username, password){ | |
| return 'Basic ' +Titanium.Utils.base64encode(username+':'+password); | |
| }; | |
| var xhr = Titanium.Network.createHTTPClient(); | |
| xhr.open("GET", "http://requestb.in/1a0zngb1"); | |
| xhr.cache = false; | |
| xhr.enableKeepAlive = false; | |
| xhr.timeout = 30000; | |
| xhr.setRequestHeader("Content-type", "application/json"); |
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 count = 1; | |
| var ping = function(cb){ | |
| setTimeout(function() | |
| { | |
| console.log("P....... " + count * 200 + "ms"); | |
| count++; | |
| cb(ping); | |
| },200); | |
| } |
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
| wru.test([ | |
| { | |
| name: "Can create a pomodoro", | |
| test: function () { | |
| //Arrange | |
| var pomodoroFactory = require('../pomodoro'); | |
| //Act | |
| var p = pomodoroFactory.create({}); | |
| //Assert | |
| wru.assert(p !== undefined); |
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 createPomodoro(params) { | |
| var validOrDefaultDuration = function(duration){ | |
| var DEFAULT_POMODORO_DURATION = 1000; | |
| return (duration !== undefined) ? duration : DEFAULT_POMODORO_DURATION; | |
| } | |
| var _started = false; | |
| var _finished = false; | |
| var _duration = validOrDefaultDuration(params.duration); |
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
| <!DOCTYPE HTML> | |
| <html> | |
| <head> | |
| <script> | |
| window.onload = function(){ | |
| /* | |
| * Get mouse event coordinate converted to canvas coordinate | |
| * c: The canvas object | |
| * e: A mouse event |
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
| <!DOCTYPE HTML> | |
| <html> | |
| <head> | |
| <script> | |
| window.onload = function(){ | |
| function Ball(x, y, radius, speedX, speedY){ | |
| this.LEFT_LIMIT = 0; | |
| this.RIGHT_LIMIT = 800; | |
| this.TOP_LIMIT = 0; |