Skip to content

Instantly share code, notes, and snippets.

View jplindgren's full-sized avatar
:octocat:

João Paulo Pozo Lindgren jplindgren

:octocat:
View GitHub Profile
@jplindgren
jplindgren / Pretty Git Log
Created February 8, 2014 15:26
Pretty Git Log
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
**Add automaticaly creating an alias**
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
public static class TestHelpers
{
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue)
{
ShouldEqualWithDiff(actualValue, expectedValue, DiffStyle.Full, Console.Out);
}
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue, DiffStyle diffStyle)
{
ShouldEqualWithDiff(actualValue, expectedValue, diffStyle, Console.Out);
namespace Sagas
{
using System;
using System.Collections.Generic;
class Program
{
static ActivityHost[] processes;
@jplindgren
jplindgren / NHibernate private field mapping
Last active December 15, 2015 11:19
#NHibernate field mapping
<property name="_customerNumber" access="field" not-null="true" />
<property name="CustomerNumber" access="field.camelcase-underscore" not-null="true" />
@jplindgren
jplindgren / Money
Created August 9, 2013 21:27
Money class...
[DomainValueObject]
public struct Money
{
public static readonly NumberFormatInfo DefaultCurrencyFormat = CultureInfo.CurrentCulture.NumberFormat;
public static readonly Money Zero = new Money(0);
private readonly decimal _value;
private readonly string _currencyCode;
public string CurrencyCode
@jplindgren
jplindgren / ci.msbuild.build
Last active December 24, 2015 08:29
Exemplo Arquivo .Build (Uso com MSBuild)
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="BuildComplete" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- General Paths -->
<RootPath>$(MSBuildProjectDirectory)</RootPath>
<SrcPath>$(RootPath)\src</SrcPath>
<ReportsPath>$(RootPath)\reports</ReportsPath>
<ToolsPath>$(RootPath)\tools</ToolsPath>
<Packages>$(SrcPath)\packages</Packages>
<ExternalLib>$(SrcPath)\lib</ExternalLib>
@jplindgren
jplindgren / Go Open Source!
Created January 18, 2014 06:21
How contribute to open source projects
I was trying to find a way to finally enter in the open-source world. I've been promising to start to contribute long time ago, but never have the time and effort to do so.
However the promise still stands! I am decided to participate in an open-source project, either .net or ruby, it does not matter.
As an introduction I've created a list with importants tips.
1)Great web site to find projects and interact with people.
http://www.ohloh.net/
2)Research how to access IRCClient.
3)Create an account in stackoverflow.com
@jplindgren
jplindgren / gist:b7e963fb740f9c1122bc
Created February 10, 2016 20:38 — forked from petros/gist:110406
How to update the schema for an XPO object model
//How to update an XPO schema and create the XPObjectType table
using (Session session = new Session())
{
//Here we select one class from each assembly that contains XPO classes
//For example User is one of our XPO object model classes
Assembly[] array = { typeof(User).Assembly, typeof(XPObjectType).Assembly };
session.UpdateSchema(array);
}
@jplindgren
jplindgren / 01-Update-Windows.ps1
Created March 16, 2016 17:40 — forked from ChaseFlorell/01-Update-Windows.ps1
Boxstarter Installation Scripts
# http://boxstarter.org/package/url?
#####################
# BEGIN CONFIGURATION
#####################
#region Initial Windows Config
Install-WindowsUpdate -AcceptEula
Update-ExecutionPolicy Unrestricted