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
import xmlrpclib | |
class comment: | |
def __init__(self, content, author, author_url, author_email, comment_parent = 0): | |
self.comment_parent = comment_parent | |
self.content = content | |
self.author = author | |
self.author_url = author_url | |
self.author_email = author_email |
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
from datetime import * | |
class ConsoleMessageWriter: | |
def __init__(self): | |
pass | |
def write(self, message): | |
print message | |
class LoggedMessageWriter: |
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
using System; | |
using System.Configuration; | |
using System.Threading; | |
using System.Collections; | |
using System.Collections.Generic; | |
namespace HelloDI | |
{ | |
public class MainClass | |
{ |
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> | |
<head> | |
<script> | |
window.onload = function(){ | |
function Ball(x, y, radius, speedX, speedY){ | |
this.LEFT_LIMIT = 0; | |
this.RIGHT_LIMIT = 800; | |
this.TOP_LIMIT = 0; |
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> | |
<head> | |
<script> | |
window.onload = function(){ | |
/* | |
* Get mouse event coordinate converted to canvas coordinate | |
* c: The canvas object | |
* e: A mouse event |
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 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 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 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 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 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 ; |
OlderNewer