Skip to content

Instantly share code, notes, and snippets.

View tucaz's full-sized avatar

tucaz tucaz

View GitHub Profile
@tucaz
tucaz / gist:1285950
Created October 14, 2011 00:47
Modules + PubSub
//Module
Widget = function (core) {
var Entry = function (entryText, accountId) {
this.EntryText = entryText;
this.AccountId = accountId;
};
var EntriesViewModel = function () {
var that = this;
@tucaz
tucaz / gist:1320202
Created October 27, 2011 17:26
Kill me now please
function PrintContent() {
printWindow = window.open("", "mywindow", "location=0,status=0,scrollbars=1,resizable=1");
var strContent = "<html><head>";
strContent = strContent + "<title" + ">Print Preview</title>";
strContent = strContent + "<link href=\"Styles/jqGrid/ui.jqgrid.css\" type=\"text/css\" rel=\"Stylesheet\" />";
strContent = strContent + "<link href=\"Styles/JQueryUI/jquery-ui-1.8.16.custom.css\" type=\"text/css\" rel=\"Stylesheet\" />";
strContent = strContent + "<link href=\"Styles/ASI/Main.css\" type=\"text/css\" rel=\"Stylesheet\" />";
strContent = strContent + "<script type=\"text/javascript\" src=\"ClientScript/Shared/jquery-1.6.2.min.js\"></scr" + "ipt>";
@tucaz
tucaz / gist:1330999
Created November 1, 2011 16:24
jqGridWrapper
var myNamespace = myNamespace || {};
myNamespace.jqGridWrapper = function (gridId, pagerId, gridUrl, gridConfig) {
var grid = $(gridId).jqGrid({
url: gridUrl,
datatype: "json",
colNames: gridConfig.colNames,
colModel: gridConfig.colModel,
rowNum: 10,
rowList: [10, 20, 30],
@tucaz
tucaz / gist:1557665
Created January 3, 2012 23:59
LOL Lisp
;5 + 4 (2 - (3 - (6 + 4/5))) / 3(6 - 2)(2 - 7)
(/ (+ 5 4
(- 2
(- 3
(+ 6
(/ 4 5)
)
)
)
sSQL = @"SELECT
A.CTA_ID,
A.CTA_AG_NUM,
A.CTA_AG_NOM,
A.CTA_NUM,
A.CTA_NOM_GRT,
A.CTA_BCO_ID,
B.BCO_NOM,
A.CTA_DD_TEL,
A.CTA_TEL,
@tucaz
tucaz / POP3.cs
Created January 30, 2012 23:36
Sample usage of AE.NET.Mail
//Sample usage of AE.NET.Mail
//https://github.com/andyedinborough/aenetmail
using (var pop = new AE.Net.Mail.Pop3Client(_host, _username, _password, _port, _useSSL))
{
var count = pop.GetMessageCount();
for (var i = count - 1; i >= 0; i--)
{
var msg = pop.GetMessage(i, false);
@tucaz
tucaz / gist:2313254
Created April 5, 2012 19:01
Namespace declaration in JS
if (typeof(MyNamespace) != "object") { var MyNamespace = {}; }
MyNamespace.ChildObject = {};
A Sonda Marciana
Regras
O problema descrito abaixo requer alguma forma de entrada de dados. Você está livre pra implementar qualquer mecanismo de entrada de dados que desejar na sua solução (dados hard coded dentro de um test unitário, por exemplo).
Você deve prover evidência suficiente de que sua solução está completa para, no mínimo, indicar que funciona corretamente para o consjunto de dados de testes fornecidos.
Recomendamos que você utilize um framework de testes como NUnit ou MSTest. Mesmo que você não tenha os utilizado antes, são fáceis de aprender e incrivelmente uteis.
@tucaz
tucaz / ModalSpecs.js
Created October 23, 2012 00:11
Knockout JS + Testes com Jasmine
describe("Modal", function () {
beforeEach(function () {
this.addMatchers({
toExist: function () {
return this.actual != null;
},
toBeHidden: function () {
return this.actual.vm.visivel() === false;
},
toBeDisplayed: function () {
google-site-verification: google14553faac4a24dde.html