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 Event = function Event() {}; | |
// Define a private method | |
Event.prototype._target; | |
// Define a set value function | |
Event.prototype.set = function set( value ) { | |
value = value || ''; | |
if ( value ) { |
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 Event = (function () { | |
var Event = function Event() {}; | |
Event.prototype._target; | |
Event.prototype.set = function set( value ) { | |
value = value || ''; | |
if ( value ) { | |
_target = value; |
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/env python | |
# coding: utf-8 | |
class Exchange( object ): | |
def __init__( self, url ): | |
''' | |
External Dependencies: Pycurl and BeautifulSoup | |
''' | |
output = False | |
try: |
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 range = function ( sequence ) { | |
var output = [] | |
if ( sequence !== undefined ) | |
for ( var pointerSequence = 0, end = sequence; pointerSequence <= end; pointerSequence += 1 ) | |
if ( pointerSequence > 0 ) | |
output.push( pointerSequence ) | |
return output | |
} |
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 page = new WebPage(), | |
address, output, size; | |
address = "http://www.metachunk.com/"; | |
width = 1024; height = 600; | |
output = "./screenshots/wat-"+width+"X"+height+".png"; | |
page.viewportSize = { width: width, height: height }; | |
if (phantom.args.length === 3 && phantom.args[1].substr(-4) === ".pdf") { |
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/env node | |
var phoneDecode = function ( input ) { | |
var output = ''; | |
var letters = { | |
ABC: 2, | |
DEF: 3, | |
GHI: 4, | |
JKL: 5, | |
MNO: 6, |
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 circle = Titanium.UI.createView({ | |
height:200, | |
width:200, | |
borderRadius:50, | |
backgroundColor:'#336699', | |
top:10, | |
left:50 | |
}); | |
currentWindow.add(circle); |
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
// Servidor HTTP | |
var http = require( 'http' ); | |
var server = http.createServer( function ( request, response ) { | |
var body = { | |
type: 'text/plain', | |
content: 'Hello World!', | |
}; | |
response.writeHead( 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
#!/usr/bin/env python | |
def cozimento( tempo_cozimento=0, a=0, b=0 ): | |
output = False | |
if tempo_cozimento and a and b: | |
if a > tempo_cozimento < b: | |
# Other stuff | |
tempo_minimo = min( a, b ) | |
tempo_maximo = max( a, b ) |
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
import unittest, miojo | |
class MiojoTest( unittest.TestCase ): | |
def test_falha_quando_nao_recebe_entradas( self ): | |
self.assertEquals( False, miojo.cozimento() ) | |
def test_tempo_cozimento_sempre_menor( self ): | |
self.assertEquals( False, miojo.cozimento( 10, 7, 5 ) ) | |
def test_tempo_para_comparacao_do_cozimento( self ): |