This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Reflection; | |
using log4net; | |
using log4net.Config; | |
//see http://logging.apache.org/log4net/release/manual/configuration.html#attributes | |
[assembly: XmlConfigurator(Watch = true)] | |
namespace Log4NetExamples.ConsoleApplication1 | |
{ | |
internal class Program |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<configSections> | |
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> | |
</configSections> | |
<log4net> | |
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender"> | |
<file value="RollingLog.log" /> | |
<appendToFile value="true" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Template Name: Contact Page | |
*/ | |
/** | |
* The template for displaying the Contact page. | |
* | |
* | |
* @package WordPress |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_ReSharper.*/ | |
package/ | |
_ReSharper* | |
*.user | |
*.suo | |
*.cache | |
*.orig | |
*.pdb | |
*.ReSharper | |
[Cc]onnection[Ss]trings.config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HomeController : Controller | |
{ | |
public ActionResult Index() | |
{ | |
//Get static SessionFactory defined in Global.asax | |
var session = MvcApplication.SessionFactory.GetCurrentSession(); | |
using (ITransaction transaction = session.BeginTransaction()) | |
{ | |
var word = new Word |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static ISessionFactory SessionFactory { get; private set; } | |
protected void Application_Start() | |
{ | |
AreaRegistration.RegisterAllAreas(); | |
RegisterGlobalFilters(GlobalFilters.Filters); | |
RegisterRoutes(RouteTable.Routes); | |
//Configure NHibernate and create a session factory for the application | |
var nhibernateConiguration = new NHibernate.Cfg.Configuration(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls *.sln | select -first 1 | %{ ii $_.FullName } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$to ="[email protected]"; | |
$subject = "PHP Mail Test"; | |
$message = "This is a PHP mail test"; | |
$headers = 'From: [email protected]' . "\r\n" . | |
'Reply-To: [email protected]' . "\r\n" . | |
'X-Mailer: PHP/' . phpversion(); | |
$success = mail($to ,$subject ,$message, $headers); | |
print("mail sending result:" + $success); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A Powershell script for creating a new solution structure, it mimics the structure of | |
# the SharpArchitecture example solution at https://github.com/sharparchitecture/Northwind | |
Clear-Host | |
#The Split-Path cmdlet returns only the specified part of a path | |
$projectFolder = Split-Path -parent $MyInvocation.MyCommand.Definition | |
new-item -path $projectFolder -name app -itemtype "directory" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using NHibernate; | |
using NHibernate.Cfg; | |
using NHibernate.Tool.hbm2ddl; | |
using lexikon.console.domain; | |
namespace lexikon.console | |
{ | |
class Program | |
{ |