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 / 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)
@vquaiato
vquaiato / Index.cshtml
Created February 22, 2011 21:14
View acessando uma collection para criar um dorpdown
@model MvcApplication5.Models.Manolo
@using System.Linq;
<!DOCTYPE html>
<html>
<head>
<title>Index</title>
</head>
<body>
<div>
@Html.DropDownListFor(model => model.Nome,
@vquaiato
vquaiato / HomeController.cs
Created February 22, 2011 21:13
Controller usanod collection para criar dopdown na view
using System.Collections.Generic;
using System.Web.Mvc;
using MvcApplication5.Models;
namespace MvcApplication5.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
private void dashboard_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
if (toolBox.PossuiComponenteSelecionado)
{
var position = e.GetPosition(this.dashboard);
var selecionado = toolBox.ComponenteSelecionado;
var template = this.FindResource("templateControlesDashboard") as ControlTemplate;
@vquaiato
vquaiato / testeinterfaceWPF.cs
Created April 6, 2011 20:31
Teste de interface com TestApi
[Test]
public void toolbox_com_1_item_gera_toolboxwindow_com_1_botao()
{
string sampleAppPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase), "Dashboard.exe");
AutomatedApplication a = new OutOfProcessApplication(new OutOfProcessApplicationSettings
{
ProcessStartInfo = new ProcessStartInfo(sampleAppPath),
ApplicationImplementationFactory = new UIAutomationOutOfProcessApplicationFactory()
});
a.Start();
@vquaiato
vquaiato / rails-3-mongo-devise.rb
Created June 23, 2011 23:43 — forked from mborromeo/rails-3-mongo-devise.rb
Rails 3 Master + MongoDB + Devise template
# This Rails template will generate a Rails 3 (MASTER) application, with MongoDB as ORM and Devise for authentication.
# You will require ruby 1.9.2-HEAD to run generated app.
file 'Gemfile', <<-GEMS
source 'http://gemcutter.org'
gem 'rails'
gem "mongoid"
gem "bson_ext"
gem "inherited_resources"
gem "devise", :git => "git://github.com/plataformatec/devise.git"