Skip to content

Instantly share code, notes, and snippets.

View fasetto's full-sized avatar
😈

Serkan Bircan fasetto

😈
View GitHub Profile
/*
html5doctor.com Reset Stylesheet
v1.6.1
Last Updated: 2010-09-17
Author: Richard Clark - http://richclarkdesign.com
Twitter: @rich_clark
*/
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
@fasetto
fasetto / git-deployment.md
Created February 2, 2018 08:56 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

@fasetto
fasetto / csharp-news.md
Last active March 22, 2018 14:15
Whats new in C# ?

C# 6.0 News

  • static import
  • when (for filtering exceptions, type switch etc.)
  • nameof operator
  • Null conditional operator (?.)
  • string interpolation
  • Expression bodied function members ( func => ...dosomething)
  • Index initializers
  • await in catch-finally blocks

Branching strategies

  • master
  • dev
  • feature
  • next
  • iss53
  • iss53v2
  • hotfix

Take Care Of Your Body

  • Exercise often
  • Eat Healthy & Stay hydrated
  • Stand up at least every hour
  • Get plently of sleep
  • Take care of your eyes

Take Care Of Your Mind

[TestClass]
public class RepoTests
{
UnitOfWork unitOfWork = new UnitOfWork(new MongoDataContext("mongodb://localhost:27017/sampledb"));
[TestInitialize]
public async Task Initialize()
{
var serkan = new User()
{
public virtual async Task<IEnumerable<TEntity>> GetByFieldAsync(string field, string value)
{
var filter = Builders<TEntity>.Filter.Eq(field, value);
var result = await Collection.Find(filter).ToListAsync();
return result;
}
public virtual async Task<TEntity> GetByIdAsync(ObjectId id)
{
public class UnitOfWork
{
private readonly MongoDataContext _dataContext;
public UserRepository Users { get; private set; }
public UnitOfWork(MongoDataContext dataContext)
{
_dataContext = dataContext;
public class UserRepository : MongoRepository<User>
{
private readonly MongoDataContext _dataContext;
protected override IMongoCollection<User> Collection => _dataContext.Database.GetCollection<User>("users");
public UserRepository(MongoDataContext dataContext)
: base(dataContext)
{
_dataContext = dataContext;
}
public abstract class MongoRepository<TEntity> : IRepository<TEntity>
where TEntity : EntityBase
{
protected abstract IMongoCollection<TEntity> Collection { get; }
public MongoRepository(MongoDataContext dataContext)
{
}
public virtual async Task AddNewAsync(TEntity entity)