Skip to content

Instantly share code, notes, and snippets.

View joaofx's full-sized avatar
😁

Joao Carlos Clementoni joaofx

😁
View GitHub Profile
//// TODO: dry
DependencyResolver.SetResolver(new StructureMapDependencyResolver());
FilterProviders.Providers.Add(new StructureMapFilterAttributeFilterProvider());
//// TODO: dry
GlobalFilters.Filters.Add(new HandleErrorAttribute());
GlobalFilters.Filters.Add(new UnitOfWorkFilter());
//// TODO: dry
ViewEngines.Engines.Clear();
Install Express.js on Windows
=============================
npm install -g express-generator@4
@joaofx
joaofx / install rails.md
Last active August 29, 2015 14:09
Commands to install ruby, node and rails in a new ubuntu machine
@joaofx
joaofx / New Dev Machine Script.txt
Last active August 29, 2015 14:09
New Dev Machine Script
choco install VisualStudioCommunity2013 -InstallArguments "/Features:'VC_MFC_Libraries WebTools'"
choco install VS2013.3
choco install git
choco install SublimeText3
choco install winrar
choco install firefox
choco install clink
choco install notepadplusplus
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
@joaofx
joaofx / DependencyConfig.cs
Last active August 29, 2015 14:14
Add and configure StructureMap in an ASP.NET MVC 5 Project
public class DependencyConfig
{
public static void RegisterDependencies()
{
var container = new Container();
container.Configure(cfg => cfg.Scan(scan =>
{
scan.TheCallingAssembly();
scan.WithDefaultConventions();
@joaofx
joaofx / Burn.bat
Created August 26, 2016 10:37
Delete bin and obj recursively on Windows
REM delete bin
for /r %R in (bin) do if exist %R (rd /s /q "%R")
REM delete obj
for /r %R in (obj) do if exist %R (rd /s /q "%R")
@joaofx
joaofx / 201501011618_CreateProduct.cs
Last active March 30, 2017 12:58
Migration Conventions
[Migration(201501011618)]
public class CreateProduct : AutoReversingMigration
{
public override void Up()
{
Create.Table("Product")
.WithPrimaryKey() // .WithColumn(p => p.Id).AsInt64().NotNullable().PrimaryKey().Identity()
.WithName() // .WithColumn("Name").AsString(64).NotNullable()
@joaofx
joaofx / endpoints.cs
Created December 22, 2016 16:55 — forked from KevM/endpoints.cs
FubuContinuations do not redirect when a simple checkbox is present on the input model?
public class get_handler
{
public SignInModel Execute(SignInRequest request)
{
return new SignInModel {ReturnUrl = request.ReturnUrl, LoginFailed = request.LoginFailed};
}
}
public class post_handler
{