Skip to content

Instantly share code, notes, and snippets.

View tangzero's full-sized avatar
🏠
Working from home

Jairinho tangzero

🏠
Working from home
View GitHub Profile
@tangzero
tangzero / gideroscc.lua
Last active December 28, 2015 17:09
Gideros Class-Commons interface. see https://github.com/bartbes/Class-Commons
-- 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
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"
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:
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")
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)
@tangzero
tangzero / open_url.py
Created February 28, 2013 18:12
urllib2.urlopen
import urllib2
print urllib2.urlopen("http://www.google.cl").read()
@tangzero
tangzero / invaders.pde
Created September 5, 2012 21:46 — forked from spoike/invaders.pde
Space Invaders Generator
/**
* 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;
@tangzero
tangzero / http_server.py
Created February 28, 2012 18:33
Basic HTTP Server in Python
#!/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
@tangzero
tangzero / Absurdo.java
Created October 12, 2011 19:01
Absurdo
...
if (condition) {
service.doSomething(arg1, arg2, arg3, arg4, arg5, arg6, ... , arg100, true);
} else {
service.doSomething(arg1, arg2, arg3, arg4, arg5, arg6, ... , arg100, false);
}
...
>>> type(1)
<type 'int'>
>>> type(2.5)
<type 'float'>
>>> type("foobar")
<type 'str'>
>>> variavel = 1
>>> type(variavel)
<type 'int'>
>>> variavel = 2.5