Skip to content

Instantly share code, notes, and snippets.

View vndmtrx's full-sized avatar
💅
Fazendo vários nadas

Eduardo N.S.R. vndmtrx

💅
Fazendo vários nadas
View GitHub Profile
Function busca_ultimo_registro(ByVal plan as String) as Object
Dim rows as Object
Dim i as Integer
rows = ThisComponent.getSheets().getByName(plan).getRows()
i = 0
Do
i = i + 1
Loop while rows.getByIndex(i).getCellByPosition(0,0).String <> ""
@vndmtrx
vndmtrx / gist:2968271
Created June 21, 2012 20:16
Macro Planilha Orçamento
REM ***** BASIC *****
'http://wiki.documentfoundation.org/images/d/d8/0312CG3-CalcMacros.odt
option explicit
sub efetua_lancamento
'Doc = ThisComponent
@vndmtrx
vndmtrx / gist:2969691
Created June 22, 2012 01:31
Macro DuploLancamento
REM ***** BASIC *****
'
' Macro DuploLancamento
'
' Macro para LibreOffice Calc criada com objetivo de fazer duplo lançamento de transferências entre contas,
' de acordo com a estrutura das tabelas de conta.
'
' Eduardo Rolim - www.tocadoelfo.com.br
' Palmas - 2012
@vndmtrx
vndmtrx / tinystackr3.py
Created July 19, 2012 18:46 — forked from vgel/tinystackr3.py
Tiny stack-based language in python.
stack = []
compileStacks = []
words = {}
builtins = {}
lambdaType = type(lambda x: x) #cannot compare against the function type directly for some reason
def prn(o):
print(o)
def clr(l):
@vndmtrx
vndmtrx / gist:3230540
Created August 1, 2012 20:40 — forked from anonymous/gist:3193057
InterfaceLIFT Scraper
import os, math, re, urllib
scraping = "http://interfacelift.com/wallpaper/downloads/date/widescreen/1440x900/"
goal = 10
done = 0
tag = re.compile(r"<a href=\"(?P<url>[^\"]+)\"><img src=\"/img_NEW/button_download\.png\"")
if not os.path.exists("scraped") :
os.makedirs("scraped")
for page in range(1, 1 + int(math.ceil(goal / 10.0))):
list = tag.finditer(urllib.urlopen(scraping + "index" + str(page) + ".html").read())
for i in list:
@vndmtrx
vndmtrx / steamsum.v1.js
Created August 2, 2012 19:04
Calculando Custo total de jogos da Steam
transacoes = document.getElementsByClassName("transactionRowPrice");
total = 0;
for (i = 0; i < transacoes.length; i++) {
custo = Number(transacoes[i].innerText.substr(1));
if (custo) {
total += custo;
}
}
@vndmtrx
vndmtrx / steam.v2.js
Created August 2, 2012 19:05
Cálculo do valor gasto em jogos na Steam
(function() {
var transacoes = document.getElementsByClassName("transactionRowPrice");
total = 0;
for(var i = 0; i < transacoes.length; i++){
var custo = parseFloat(transacoes[i].innerHTML.substr(1));
if(!isNaN(custo)) {
total += custo;
}
}
console.log(total);
@vndmtrx
vndmtrx / jquery_inject.js
Created August 2, 2012 19:06
Injetando jquery via console
(function() {
var script = document.createElement("script");
script.src = "//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js";
script.onload = script.onreadystatechange = function(){ console.log("done;"); };
document.body.appendChild(script);
})();
@vndmtrx
vndmtrx / bookmarklet_jquery.js
Created August 3, 2012 20:29
Bookmarklet para inserção e verificação de jQuery na página.
(function() {
var outralib = false;
var msg = '';
var criapainel = function() {
var div = document.createElement("div");
div.style.zIndex = 1001;
div.style.backgroundColor='#c90';
div.style.color='#fff';
div.style.fontFamily = 'sans-serif';
@vndmtrx
vndmtrx / jquery_gasto_steam.js
Created August 5, 2012 14:53
Cálculo do valor gasto em jogos na Steam usando jQuery
(function() {
var total = 0;
$jq("#store_transactions .block").each(function(i, v) {
var sum = 0;
$jq(v).find(".transactionRowPrice").each(function(ii, vv){
//console.log(i + ": " + $jq(vv).text());
custo = parseFloat($jq(vv).text().substr(1));
if(!isNaN(custo)) {
sum += custo;
}