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
-- Interface for cross class-system compatibility | |
-- see https://github.com/bartbes/Class-Commons. | |
if common_class ~= false then | |
common = {} | |
function common.class(name, prototype, parent) | |
local class = parent and Core.class(parent) or Core.class() | |
local class.__name = name | |
if prototype then |
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
package.preload['hp/core/Application'] = (function (...) | |
-------------------------------------------------------------------------------- | |
-- Module for the start of the application.<br> | |
-- | |
-- @class table | |
-- @name Application | |
-------------------------------------------------------------------------------- | |
-- import | |
local Event = require "hp/event/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
package.preload['hc.class'] = (function (...) | |
--[[ | |
Copyright (c) 2010-2011 Matthias Richter | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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
require 'pathname' | |
require 'rbconfig' | |
require 'fileutils' | |
module BasicMoai | |
ROOT_FOLDER = File.expand_path(File.join(File.dirname(__FILE__), "..")) | |
SRC_FOLDER = File.join(ROOT_FOLDER, "src") | |
VENDOR_FOLDER = File.join(ROOT_FOLDER, "vendor") | |
TMP_FOLDER = File.join(ROOT_FOLDER, "tmp") |
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
system = require("spine-hp/system") | |
spine = require("spine-hp/spine") | |
local width, height = 640, 480 | |
MOAISim.openWindow("MOAI and Spine", width, height) | |
local viewport = MOAIViewport.new() | |
viewport:setSize(width, height) | |
viewport:setScale(width, -height) |
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 urllib2 | |
print urllib2.urlopen("http://www.google.cl").read() |
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
/** | |
* Space invaders generator. Generates and draws invaders. Inspired | |
* by invaders fractals: | |
* http://www.levitated.net/daily/levInvaderFractal.html | |
* | |
* Mouse press will create new invaders and draw the new ones. | |
*/ | |
/** Scaling factor */ | |
float sc = 3f; |
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 | |
import SocketServer | |
from os.path import getsize | |
from mimetypes import read_mime_types | |
from datetime import date | |
# Mon, 27 Jul 2009 12:28:53 GMT | |
template = """HTTP/1.1 200 OK |
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
... | |
if (condition) { | |
service.doSomething(arg1, arg2, arg3, arg4, arg5, arg6, ... , arg100, true); | |
} else { | |
service.doSomething(arg1, arg2, arg3, arg4, arg5, arg6, ... , arg100, false); | |
} | |
... |
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
>>> type(1) | |
<type 'int'> | |
>>> type(2.5) | |
<type 'float'> | |
>>> type("foobar") | |
<type 'str'> | |
>>> variavel = 1 | |
>>> type(variavel) | |
<type 'int'> | |
>>> variavel = 2.5 |