Skip to content

Instantly share code, notes, and snippets.

View NTCoding's full-sized avatar

Nick Tune NTCoding

View GitHub Profile
-module(scraper).
-compile(export_all).
start() ->
scrape(1).
scrape(X) ->
inets:start(),
-module(scraper).
-compile(export_all).
start() ->
spawn(fun() -> start_scraper_with_monitoring() end).
start_scraper_with_monitoring() ->
Pid = start_scraper_on_available_node(),
public class EnglishJobsHandler
{
private readonly IEnglishJobsFinder englishJobsFinder;
private readonly IAllJobsFinder allJobsFinder;
public EnglishJobsHandler(IEnglishJobsFinder englishJobsFinder, IAllJobsFinder allJobsFinder)
{
this.englishJobsFinder = englishJobsFinder;
this.allJobsFinder = allJobsFinder;
}
public class EnglishJobsHandler
{
private readonly IEnglishJobsFinder englishJobsFinder;
private readonly IAllJobsFinder allJobsFinder;
public EnglishJobsHandler(IEnglishJobsFinder englishJobsFinder, IAllJobsFinder allJobsFinder)
{
this.englishJobsFinder = englishJobsFinder;
this.allJobsFinder = allJobsFinder;
}
public class EnglishJobsHandler
{
private readonly IEnglishJobsFinder englishJobsFinder;
private readonly IAllJobsFinder allJobsFinder;
public EnglishJobsHandler(IEnglishJobsFinder englishJobsFinder, IAllJobsFinder allJobsFinder)
{
this.englishJobsFinder = englishJobsFinder;
this.allJobsFinder = allJobsFinder;
}
public class JobsFinder<TJobFinder, TModel> where TJobFinder : ICommonJobFinder // always great to add generics & had to create common job finder interface
where TModel : ICommonJobsModel, new() // nice
{
private readonly IAllJobsFinder allJobsFinder;
private readonly TJobFinder specificJobFinder;
public JobsFinder(IAllJobsFinder allJobsFinder, TJobFinder specificJobFinder)
{
this.allJobsFinder = allJobsFinder;
this.specificJobFinder = specificJobFinder;
public class JobsFinder<TJobFinder, TModel> where TJobFinder : ICommonJobFinder
where TModel : ICommonJobsModel, new()
{
private readonly IAllJobsFinder allJobsFinder;
private readonly TJobFinder specificJobFinder;
public JobsFinder(IAllJobsFinder allJobsFinder, TJobFinder specificJobFinder)
{
this.allJobsFinder = allJobsFinder;
this.specificJobFinder = specificJobFinder;
@NTCoding
NTCoding / gist:4184443
Created December 1, 2012 19:40
full_stack_context_specification
[TestFixture]
public class Creating_a_useful_plan : RavenTestsBase
{
private FubuContinuation response;
private LifeLesson lesson;
[TestFixtureSetUp]
public void When_adding_a_super_useful_plan()
{
BeginCleanSession();
@NTCoding
NTCoding / gist:4184455
Created December 1, 2012 19:42
Raven_tests_base
public abstract class RavenTestsBase
{
protected IDocumentSession Session;
private EmbeddableDocumentStore store;
public EmbeddableDocumentStore Store { get; private set; }
public void BeginCleanSession()
{
Store = store = new EmbeddableDocumentStore
{
@NTCoding
NTCoding / gist:4184509
Created December 1, 2012 19:49
Raven_create
public class Post
{
private readonly IDocumentSession session;
private readonly ISecurityContext security;
public Post(IDocumentSession session, ISecurityContext security)
{
this.session = session;
this.security = security;
}