This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Text.RegularExpressions; | |
using System.Threading.Tasks; | |
using HtmlAgilityPack; | |
namespace ConsoleApplication7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Net; | |
namespace ConsoleApplication2 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module("dado um deserializador de url encoded posso criar objetos"); | |
//"Nome=Alberto&Idade=22&Endereco.Logradouro=Rua%20Paulino%20Nogueira&Endereco.Numero=283&Telefones[0]=30211083&Telefones[1]=96234779&Linguagens[0].Nome=C#&Linguagens[0].Tipo=FortementeTipada&Linguagens[1].Nome=Javascript&Linguagens[1].Tipo=DinamicamenteTipada"; | |
test("com so uma propriedade a partir de uma url encoded", function () { | |
var url = "Nome=Alberto&Idade=22"; | |
var obj = form2json(url); | |
equal(obj.Nome, "Alberto"); | |
equal(obj.Idade, "22"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq.Expressions; | |
using System.Reflection.Emit; | |
namespace ConsoleApplication11 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Func<T, bool> GetExpressionOfEquals<T>(string propertyName, string equalsTo) | |
{ | |
var parameter = Expression.Parameter(typeof(T)); | |
var property = Expression.Property(parameter, propertyName); | |
var binaryExpression = Expression.Equal(property, Expression.Constant(equalsTo)); | |
var lambda = Expression.Lambda<Func<T, bool>>(binaryExpression, "Teste", new[] { parameter }); | |
var expression = lambda.Compile(); | |
return expression; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Net; | |
namespace ConsoleApplication9 | |
{ | |
class Program | |
{ | |
static string str = @"------WebKitFormBoundaryoCMA9W1hTtsLzZ8e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
type: 'POST', | |
url: url, | |
data: $('form').serialize(), | |
success: function(a) { | |
console.log("success",a); | |
} , | |
statusCode: { | |
200: function(a) { | |
console.log("200",a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ko.bindingHandlers.date = { | |
update: function(element, valueAccessor) { | |
ko.bindingHandlers.value.update.apply(this, arguments); | |
var value = ko.utils.unwrapObservable(valueAccessor()); | |
var prop = $(element).is('input') ? 'value' : 'innerText'; | |
if (Date.isDate(value)) | |
element[prop] = $.datepicker.formatDate("dd/mm/yy", value); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Using SQL-like Expression | |
var iNames = from i in employees | |
select i.name; | |
2) Using Lambda Expression | |
var iNames = employees.Select(r => r.name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xml? version="1.0" encoding="utf-8"?> | |
<Project xmlns="http://schemas.microsoft.com/developer/MsBuild/2003"> | |
<UsingTask TaskName="CompressorTask" AssemblyFile="Yahoo.Yui.Compressor.MsBuildTask.dll" /> | |
<PropertyGroup> | |
<CssOutputFile Condition=" '$(CssOutputFile)'=='' ">$(ProjectDir)..\Content\CssFinal.css</CssOutputFile> | |
<JavaScriptOutputFile Condition=" '$(JavaScriptOutputFile)'=='' ">$(ProjectDir)..\Scripts\JsFinal.js</JavaScriptOutputFile> | |
</PropertyGroup> | |
<Target Name="MyTaskTarget"> | |
<ItemGroup> | |
<CssFiles Include="'$(ProjectDir)'\..\..\Content\Site.css"/> |