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 / 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()
{
@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,
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"
@vquaiato
vquaiato / xaml_samples.xaml
Created August 6, 2011 02:23
Complex types properties
<!--
Background é uma propriedade do objeto Button
E pode ser setada para um tipo complexo no XAML
Como mostrado abaixo
-->
<Button>
<Button.Background>
<SolidColorBrush Color="Blue" />
</Button.Background>
</Button>
<div style="padding-left:110px">
<div class="submit">
<div style="padding-left:5px">
<div class="inputBtAzulPModalBG">
<div class="inputBtAzulPModalEsq">
<div class="inputBtAzulPModalDir">
<div class="inputBtAzulPModal">Enviar</div>
</div>
</div>
</div>
@vquaiato
vquaiato / yuno.sh
Created December 1, 2011 15:00
command-line YUNO memegenerator
#!/bin/bash
convert -background transparent -gravity center -size 390x60 -font Impact-Normal label:"$2" yuno_base.jpg +swap -gravity south -composite yuno.jpg
convert -background transparent -gravity center -size 390x60 -font Impact-Normal label:"$1" yuno.jpg +swap -gravity north -composite yuno.jpg
@vquaiato
vquaiato / private_members_access.rb
Created December 14, 2011 02:22
Accessing private instance variables from other objects in Ruby
class Foo
@bar
def initialize(bar)
@bar = bar
end
def are_equal?(foo)
b = foo.instance_variable_get :@bar
b == @bar
end
end
@vquaiato
vquaiato / Importing posts from Wordpress into Jekyll.rb
Created December 29, 2011 00:24 — forked from vitobotta/Importing posts from Wordpress into Jekyll.rb
The script I used to import posts from my Wordpress blog into a new Jekyll one.
%w(rubygems sequel fileutils yaml active_support/inflector).each{|g| require g}
require File.join(File.dirname(__FILE__), "downmark_it.rb")
module Jekyll
module WordPress
def self.process(dbname = 'SEU_DB_NAME', user = 'SEU_DB_USER', pass = 'SEU_DB_PASS', host = 'localhost', table_prefix = 'wp_')
db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host, :encoding => 'utf8')
%w(_posts _drafts images/posts/featured).each{|folder| FileUtils.mkdir_p folder}