Skip to content

Instantly share code, notes, and snippets.

@elranu
elranu / gist:4586542
Created January 21, 2013 14:42
TableMapper: Automatic Table Mapper for Dynamics Ax http://ranu.com.ar Example
TableMapper mp = new TableMapper();
TestTable1 tb1;
TestTable2 tb2;
;
mp.MapTable(tb1, tb2)
.Bind("Int2", "SomeInt")
.Bind("Name","FullName")
.Bind("Url", "Web")
.Ignore("Utc")
@elranu
elranu / xpo
Created September 17, 2012 22:37
How a General Journal Line is related with a Ledger post (GeneralJournalEntry)
LedgerJournalTable jourTable, origJornalTable;
LedgerJournalTrans jourTrans, origJournalTrans;
SubledgerVoucherGeneralJournalEntry jourLink;
;
origJornalTable = LedgerJournalTable::findByGeneralJournalEntry(journalEntry);
if(origJornalTable){
select * from origJournalTrans where origJournalTrans.JournalNum == origJornalTable.JournalNum
join jourLink where jourLink.GeneralJournalEntry == journalEntry.RecId && origJournalTrans.Voucher == jourLink.Voucher;
@elranu
elranu / gist:3740195
Created September 17, 2012 22:33
How a Ledger post (GeneralJournalEntry) is related with a General Journal Ledger.
public static LedgerJournalTable findByGeneralJournalEntry( GeneralJournalEntry journalEntry )
{
LedgerJournalTable journalTable;
LedgerEntryJournal journalLink;
;
select firstOnly * from journalLink where journalLink.RecId == journalEntry.LedgerEntryJournal
join journalTable where journalTable.JournalNum == journalLink.JournalNumber;// &&
//journalTable.dataAreaId == journalLink.LedgerJournalTableDataAreaId;
@elranu
elranu / mongodb_db.js
Created December 14, 2011 20:02
ueberDB support for monogDB - etherpad-lite
/**
* Mariano Julio Vicario aka Ranu - TW: @el_ranu
* http://www.ranu.com.ar
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@elranu
elranu / app.js
Created November 24, 2011 15:29
Socket.IO RedisStore and Rooms
//app.js Socket IO Test
var app = require('express').createServer(),
redis = require('socket.io/node_modules/redis'),
io = require('socket.io').listen(app);
var pub = redis.createClient(port, "url");
var sub = redis.createClient(port, "url");
var store = redis.createClient(port, "url");
pub.auth('pass', function(){console.log("adentro! pub")});
sub.auth('pass', function(){console.log("adentro! sub")});