Skip to content

Instantly share code, notes, and snippets.

View vquaiato's full-sized avatar
:octocat:
am I working?

Vinicius Quaiato vquaiato

:octocat:
am I working?
View GitHub Profile
@vquaiato
vquaiato / asyncJqueryFormSubmit.js
Created December 9, 2010 21:00
submeter um form de maneira assíncrona usando JQuery
$(function () {
$('#contato').submit(function (e) {
e.preventDefault();
validar();
$.post($(this).attr("action"), $(this).serialize(), function (json) {
alert(json);
}, "json");
});
@vquaiato
vquaiato / gist:745910
Created December 17, 2010 23:40
trecho html
<nav class="sharing">
<ul>
<li class="facebook"><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="/" show_faces="true" width="450"></fb:like></li>
<li><a href="#" class="compartilhe">Compartilhe</a></li>
<li><a href="#" class="mail">Enviar por E-Mail</a></li>
<li><a href="#" class="print">Versão para impressão</a></li>
</ul>
</nav>
..
...
@vquaiato
vquaiato / Teste muitas coisas
Created January 7, 2011 22:13
Testa muitas coisas
[Test]
20 public void GetMovesOneSquareForward_A7_ReturnsPromotions()
21 {
22 var wp = new WhitePawns(new Bitboard().Set(new Square("A7")));
23 var m = wp.GetMovesOneSquareForward();
24 var moves = m.GetEnumerator();
25
26
27 moves.MoveNext();
28 var f1 = moves.Current;
@vquaiato
vquaiato / build.proj
Created January 16, 2011 16:59
MSBuild file for the MVCTestsEx project
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="default">
<UsingTask AssemblyFile="$(MSBuildProjectDirectory)\..\lib\NuGetTasks\NuGet.MSBuild.dll" TaskName="NuGet.MSBuild.NuGet" />
<PropertyGroup>
<Configuration Condition="'$(Configuration)'==''" >Release</Configuration>
<BaseDir>$(MSBuildProjectDirectory)\..</BaseDir>
<BuildDir>$(BaseDir)\build</BuildDir>
<BuildDirBin>$(BaseDir)\build\bin</BuildDirBin>
@vquaiato
vquaiato / Sharepoint_select.cs
Created January 25, 2011 16:55
selecionando arquivos de uma biblioteca Sharepoint
StringBuilder str = new StringBuilder();
str.Append("<OrderBy> ");
str.Append(" <FieldRef Name='Data' Ascending='False' /> ");
str.Append("</OrderBy> ");
str.Append("<Where> ");
str.Append(" <Eq> ");
str.Append(" <FieldRef Name='Visivel' /> ");
str.Append(" <Value Type='Boolean'>1</Value> ");
str.Append(" </Eq> ");
@vquaiato
vquaiato / AppStart_NinjectMVC3.cs
Created January 31, 2011 23:05
Arquivo criado pelo NuGet no install do Ninject.MVC3
using System.Web.Mvc;
using Ninject;
using Ninject.Mvc3;
[assembly: WebActivator.PreApplicationStartMethod(typeof(MvcApplication1.AppStart_NinjectMVC3), "Start")]
namespace MvcApplication1 {
public static class AppStart_NinjectMVC3 {
public static void RegisterServices(IKernel kernel) {
//kernel.Bind<IThingRepository>().To<SqlThingRepository>();
@vquaiato
vquaiato / MeuDependencyResolver.cs
Created February 1, 2011 18:08
Exemplo manual IDependencyResolver
public class MeuDependencyResolver : IDependencyResolver
{
private HashSet<object> dependencias;
public MeuDependencyResolver()
{
this.dependencias.Add(new DummyDependencia1());
this.dependencias.Add(new DummyDependencia2());
this.dependencias.Add(new DummyDependencia2_2());
}
public class MeuDependencyResolver : IDependencyResolver
{
private ILookup<Type, object> lookup;
private HashSet<object> dependencias = new HashSet<object>();
public MeuDependencyResolver()
{
this.dependencias.Add(new DummyDependencia1());
this.dependencias.Add(new DummyDependencia2());
this.dependencias.Add(new DummyDependencia2_2());
@vquaiato
vquaiato / push,ps1
Created February 8, 2011 19:44
"Push" deploy on Windows Azure
Param($S,$I,$Cert,$L,$P,$Cfg)
$start = Get-Date
$service_name = $S
$subscription_id = $I
$certificate = $Cert
$label = $L
$package = $P
$config_file = $Cfg
@vquaiato
vquaiato / Dashboard.cs
Created February 17, 2011 20:37
Very simples canvas dashboard in WPF
public partial class MainWindow : Window
{
private Line line = null;
private Brush oldBrush;
public MainWindow()
{
InitializeComponent();
}
void onDragDelta(object sender, DragDeltaEventArgs e)