Skip to content

Instantly share code, notes, and snippets.

View owickstrom's full-sized avatar

Oskar Wickström owickstrom

View GitHub Profile
@owickstrom
owickstrom / GetFromTo.cs
Created December 30, 2012 14:27
Possible solution (not tested)
public virtual IEnumerable<Commit> GetFromTo(DateTime start, DateTime end)
{
this.ThrowWhenDisposed();
Logger.Debug(Resources.GettingAllCommitsFromToTime, start, end);
var selectedCommitIds = this.stamps.Where(x => x.Value >= start && x.Value < end).Select(x => x.Key);
var firstCommitId = selectedCommitIds.FirstOrDefault();
var lastCommitId = selectedCommitIds.LastOrDefault();
if (lastCommitId == Guid.Empty && lastCommitId == Guid.Empty)
@owickstrom
owickstrom / Thing.cs
Created October 17, 2012 07:54
A simple Continuous Integration and Deployment workflow with ASP.NET MVC, GitHub and Jenkins (Changing the model)
public class Thing
{
public long ThingId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}
@owickstrom
owickstrom / .gitignore
Created October 17, 2012 07:52
A simple Continuous Integration and Deployment workflow with ASP.NET MVC, GitHub and Jenkins
# Ignore dot-files, except the .gitignore file.
.*
!.gitignore
# (All rules from CSharp.gitignore)
@owickstrom
owickstrom / cp11-async-curl.cpp
Created July 31, 2012 16:47
C++11 Async cURL
#include <iostream>
#include <curl/curl.h>
#include <math.h>
#include <vector>
#include <future>
#include <boost/format.hpp>
#define logbase(a, b) (log(a)/log(b))
using namespace std;
@owickstrom
owickstrom / gist:3072696
Created July 8, 2012 20:34
Aliases in Scala pattern matching
// If we have a Person class like this...
case class Person(firstName : String, lastName : String)
// ... and we want to use pattern matching to ensure
// an object is a Person with lastName "Jones" before
// send it to someFunction, we could do something like
// this:
someObject match {