Skip to content

Instantly share code, notes, and snippets.

View marcosbitetti's full-sized avatar

Marcos Augusto Bitetti marcosbitetti

View GitHub Profile
@marcosbitetti
marcosbitetti / gist:6057299
Created July 22, 2013 20:21
SVG parser to Android
private boolean readXMLConfig(Activity activity)
{
try
{
Resources res = getResources();
XmlResourceParser xpp = res.getXml(R.xml.fundo);
xpp.next();
int eventType = xpp.getEventType();
while(eventType != XmlResourceParser.END_DOCUMENT)
{
@marcosbitetti
marcosbitetti / gist:4379788
Created December 26, 2012 11:29
Simple template to use Coffee Script language
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test page</title>
<!-- javascript librarys -->
<script type="text/javascript">
<!-- //
window._debug=true;
@marcosbitetti
marcosbitetti / gist:3945435
Created October 24, 2012 10:47
Template to javascript test page
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test page</title>
</head>
<body>
<table style="border: none; width:100%; height:auto;">
<thead><tr><th colspan="2">Start...</th></tr></thead>
<script type="text/javascript">
@marcosbitetti
marcosbitetti / gist:3509766
Created August 29, 2012 10:13
Blender exporter animation to Lua table
##########################################
#
# Wild Witch Project
# http://www.wildwitchproject.com/
#
# Simple Frame sequence exporter
#
# author: marcosbitetti@gmail.com
# : http://github.com/marcosbitetti
#
@marcosbitetti
marcosbitetti / gist:3479942
Created August 26, 2012 14:13
Simple Blender animation exporter to Lua code
###################################
#
# Wild Witch Project
# http://www.wildwitchproject.com/
#
# Simple Frame sequence exporter
#
# author: marcosbitetti@gmail.com
#
###################################
@marcosbitetti
marcosbitetti / gist:3273272
Created August 6, 2012 10:26
Experiment with Controller Class for game
require 'wwp.view.aux.subtitle'
local vars = {
curTime=0, iniTime=0, iTime = 0,
subs = nil, doc = nil, dSub = nil,
tTime=1, cLay=2
}
Cine00 = __o.class(vars, GenericControler )
@marcosbitetti
marcosbitetti / gist:3246297
Created August 3, 2012 09:30
Get current real timestamp from system to Lua/C/C++
#include <sys/time.h>
static int wwp_getTimestampio(lua_State* L)
{
struct timeval tm;
gettimeofday(&tm, 0);
long double t = tm.tv_sec + tm.tv_usec*0.000001;
lua_pushnumber(L,t);
return 1;
}
@marcosbitetti
marcosbitetti / Simple Banner Slide Show.js
Created April 23, 2012 00:58
Simple slide show to banners for blog sidebar
// banner
var wwp_partners_01 = {
init:function() {
var list = $('#ID_OF_DIV_OF_BANNERS a');
for(var i=0; i<list.length; i++)
{
var item = $(list[i]);
var count = $(document.createElement('div'));
count.css({"width":""+this.maxpx+"px","height":"2px","padding":"0px","margin":"0px","position":"relative","background":"#ffffff"});
item.append(count).data("bar",count);
@marcosbitetti
marcosbitetti / SimpleBannerSlideShow
Created April 23, 2012 00:55
Simple slide show to banners for blog sidebar
// banner
var wwp_partners_01 = {
init:function() {
var list = $('#ID_OF_DIV_OF_BANNERS a');
for(var i=0; i<list.length; i++)
{
var item = $(list[i]);
var count = $(document.createElement('div'));
count.css({"width":""+this.maxpx+"px","height":"2px","padding":"0px","margin":"0px","position":"relative","background":"#ffffff"});
item.append(count).data("bar",count);
@marcosbitetti
marcosbitetti / main.cpp
Created January 14, 2012 20:24
Downloader application using pure C/C++ WinAPI
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
#include "jpeg_decoder.h"
#include "media.h"
#include "appdata.h"
#include <string.h>
#include <math.h>
#include <time.h>