Skip to content

Instantly share code, notes, and snippets.

@reharik
reharik / gist:b8d4cb65c9e16bb825d7
Created July 19, 2015 01:13
pre-compiled code for babel recursion issue
module.exports = class RegistryDSL{
constructor(){
this._declarationInProgress;
...
}
requireDirectoryRecursively(dir){
invariant(dir,'You must provide a valid directory');
var absoluteDir= path.join(appRoot.path, dir);
FROM mf/nodebox
# Maintainer
MAINTAINER Raif Harik <reharik@gmail.com>
# Expose the node.js port to the Docker host.
EXPOSE 3000
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
ADD /app/package.json /tmp/package.json
Step 13 : COPY /app /opt/app/current
---> 5a22c3f3e1a7
Removing intermediate container e25fb63a67cb
Step 14 : RUN pwd
---> Running in 252c00cda6ba
/opt/app/current
---> 57455a74dcf7
Removing intermediate container 252c00cda6ba
Step 15 : RUN ls
---> Running in a65d7cbd1818
handleEvent on the base calss
console.log(this[gesEvent.eventName]);
console.log(this[gesEvent.eventName](gesEvent.data, gesEvent.metadata.continuationId));
result
[Function: hireTrainer]
[TypeError: undefined is not a function]
async handleEvent(gesEvent) {
logger.debug('handleEvent | checking event for idempotence');
var idempotency = await readstorerepository.checkIdempotency(gesEvent.originalPosition, this.eventHandlerName);
if (!idempotency.isIdempotent) {
logger.debug('handleEvent | event is not idempotent');
return;
}
logger.trace('handleEvent | event idempotent');
try {
@reharik
reharik / WindsorContainerBootStrapper.cs
Created October 11, 2012 13:57
Windsor IOC config
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using CommonServiceLocator.WindsorAdapter;
using HSTM.Common.Web.SessionState;
using HSTM.HLC.BusinessLogic;
using HSTM.HLC.Common;
using HSTM.HLC.DataAccess;
using HSTM.HLC.Web.UI.Controllers;
using Microsoft.Practices.ServiceLocation;
@reharik
reharik / gist:3874191
Created October 11, 2012 17:40
different ioc configs
==============================
private void Start()
{
var container = new WindsorContainer();
ServiceLocator.SetLocatorProvider(() => new WindsorServiceLocator(container));
container.Install(
new HLCCommonInstaller(),
new DataAccessInstaller(),
new WebUIInstaller(),
new HLCBusinessLogicInstaller()
@reharik
reharik / gist:3954132
Created October 25, 2012 17:20
htmlHelper1
@Html.TextboxSubmission(x=>x.FirstName).ToString()
This would emit:
<div class = “surroundingElement”>
<label for=”FirstName”>First Name</label>
<input name=”FirstName” type=”text”></input>
</div>
@reharik
reharik / gist:3954200
Created October 25, 2012 17:32
JQGrid using Raif's dsl
protected override Grid<StatementSearchResultsetDTO> BuildGrid()
{
GridBuilder.LinkColumnFor(x => x.StatementName)
.ForAction<StatementController>(x => x.AddUpdate(null))
.ToPerformAction(ColumnAction.AddUpdateItem)
.ToolTip("Edit Item")
.DefaultSortColumn();
GridBuilder.DisplayFor(x => x.Description);
GridBuilder.DisplayFor(x => x.UpdateDateTime).DisplayHeader("Updated");
return this;
@reharik
reharik / gist:3954165
Created October 25, 2012 17:27
JQGrid in html
@(Html.Grid("Basic")
.SetCaption("Basic Grid")
.AddColumn(new Column("CustomerId")
.SetLabel("Id"))
.AddColumn(new Column("Name"))
.AddColumn(new Column("Company"))
.AddColumn(new Column("EmailAddress"))
.AddColumn(new Column("Last Modified"))
.AddColumn(new Column("Telephone"))
.SetUrl(Url.Action("GridDataBasic"))