Skip to content

Instantly share code, notes, and snippets.

Apostol Apostolov asapostolov

Block or report user

Report or block asapostolov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
asapostolov / file.html
Created Sep 24, 2015
City of Plovdiv's Center in Polygon
View file.html
<!DOCTYPE html>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple Polygon</title>
html, body {
height: 100%;
margin: 0;
asapostolov / config path change
Last active Aug 29, 2015
MiniBlog web.config as virtual application
View config path change
<add key="blog:path" value="myblog"/>
asapostolov / BaseController.cs
Last active Aug 29, 2015
RavenDB Session Management
View BaseController.cs
public const string RavenSessionKey = "raven.session";
public IDocumentSession RavenSession { get; set; }
protected override void Initialize( System.Web.Routing.RequestContext requestContext ) {
base.Initialize( requestContext );
RavenSession = (IDocumentSession) HttpContext.Items[ RavenSessionKey ];
asapostolov / RavenConflictsConsole
Created Jan 30, 2014
Console application for fixing RavenDB conflicts through
View RavenConflictsConsole
namespace ConsoleApplication {
class Program {
static void Main( string[] args ) {
var store = new DocumentStore() {
Url = "<your-url-here>",
Credentials = new System.Net.NetworkCredential() {
UserName = "<your-username>",
Password = "<your-password>",
asapostolov / Raven Conflicts
Created Jan 30, 2014
RavenDB index for getting all the conflicted documents from a database.
View Raven Conflicts
from doc in docs
where doc["@metadata"]["Raven-Replication-Conflict"]
select new { Id = doc.__document_id }
View .gitattributes
# Auto detect text files and perform LF normalization
* text=auto
# These files are text and should be normalized (convert crlf => lf)
*.cs text diff=csharp
*.java text diff=java
*.html text diff=html
*.js text
*.cshtml text
asapostolov / Raven-DB-Document-Manager.cs
Created Mar 3, 2012
Initalizes and manages RavenDB Document Store and Session. Initalize() method must be called in Application_Start event to initialize the store and optionally - SessionSaveAndClose() on Application_PostRequestHandlerExecute to save the changes.
View Raven-DB-Document-Manager.cs
public class DocumentManager
public static readonly string SessionKey = "current.session";
public static IDocumentStore CurrentDocumentStore { get; private set; }
public static IDocumentSession CurrentSession
You can’t perform that action at this time.