Skip to content

Instantly share code, notes, and snippets.

View OliverRC's full-sized avatar
🤩
coding my heart out

Oliver Rivett-Carnac OliverRC

🤩
coding my heart out
View GitHub Profile
@OliverRC
OliverRC / border-box
Created May 3, 2013 09:32
Border Box
*
{
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
@OliverRC
OliverRC / disable-user-select
Created July 24, 2013 10:44
Disable User Selection
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
@OliverRC
OliverRC / ef-target-migration
Created August 13, 2013 13:12
EF Target Migration
Update-Database –TargetMigration: AddBlogUrl
@OliverRC
OliverRC / teamcity-csproj-build
Created August 14, 2013 09:01
TeamCity - CS Project
<PropertyGroup>
<WorkingDir Condition="'$(WorkingDir)' == ''">$(MSBuildProjectDirectory)\..\..\</WorkingDir>
<BuildDir Condition="'$(BuildDir)' == ''">$(WorkingDir)build\</BuildDir>
</PropertyGroup>
<Target Name="ValidateBuildProperties">
<Error Text="The WorkingDir property is not defined." Condition="'$(WorkingDir)' == ''" />
<Error Text="The WorkingDir must have a trailing slash." Condition="!HasTrailingSlash('$(WorkingDir)')" />
<Error Text="The BuildDir property is not defined." Condition="'$(BuildDir)' == ''" />
<Error Text="The BuildDir must have a trailing slash." Condition="!HasTrailingSlash('$(BuildDir)')" />
</Target>
@OliverRC
OliverRC / includes
Created August 23, 2013 09:07
Includes Helper
private static DbQuery<Models.___> ___Includes(DbSet<Models.___> dbSet)
{
return dbSet.Include("___");
}
@OliverRC
OliverRC / basic-ef-query
Created August 23, 2013 09:08
Basic EF Query
using (var db = new ___DBContext())
{
var ___ = (from x in ___Includes(db.___)
where x.Id == id
select x).FirstOrDefault();
return ___;
}
@OliverRC
OliverRC / groupby-multiple
Created September 12, 2013 15:28
Group by multiple columns
group x by new { x.Column1, x.Column2 }
@OliverRC
OliverRC / no-wrap.css
Created October 8, 2013 11:29
No Wrap
white-space: nowrap;
@OliverRC
OliverRC / custom-errors.xml
Created October 8, 2013 13:27
Custom Errors Asp.NET
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
@OliverRC
OliverRC / cte.sql
Created October 25, 2013 09:00
Common Table Expression or CTE
;WITH cte_1 AS
(
)