This file contains 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
process.send('I am ok') | |
process.exit(0); |
This file contains 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
upstream jsreport { | |
# change port 8080 with the port you are running jsreport on | |
server 127.0.0.1:8080; | |
keepalive 15; | |
} | |
server { | |
listen 80; | |
# change my-domain.net with the host you run nginx on |
This file contains 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
module.exports = { | |
'name': 'query-string', | |
'main': 'queryString.js' | |
} |
This file contains 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
# .ebextensions/01-ebs.config | |
commands: | |
01clear-if-unmounted: | |
command: if ! mount | grep /media/ebs_volume > /dev/nul; then rm -rf /media/ebs_volume; fi | |
02attach-volume: | |
command: aws ec2 attach-volume --region eu-central-1 --volume-id vol-ddb08e34 --instance-id $(curl -s http://169.254.169.254/latest/meta-data/instance-id) --device /dev/sdh | |
ignoreErrors: true | |
03wait: | |
command: sleep 10 | |
04trymount: |
This file contains 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
# .ebextensions/01-ebs.config | |
commands: | |
01clear-if-unmounted: | |
command: if ! mount | grep /media/ebs_volume > /dev/nul; then rm -rf /media/ebs_volume; fi | |
02attach-volume: | |
command: aws ec2 attach-volume --region eu-central-1 --volume-id vol-ddb08e34 --instance-id $(curl -s http://169.254.169.254/latest/meta-data/instance-id) --device /dev/sdh | |
ignoreErrors: true | |
03wait: | |
command: sleep 10 | |
04trymount: |
This file contains 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
function afterRender(done) { | |
var SendGrid = require('sendgrid'); | |
var sendgrid = new SendGrid('xxx', 'xxx'); | |
sendgrid.send({ | |
to: request.data.email, from: '[email protected]', subject: request.template.name, | |
html: new Buffer(response.content).toString() | |
}, function(err, message) { | |
if (err) | |
done(err); |
This file contains 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 UnfilteredFlushListener : DefaultFlushEventListener | |
{ | |
protected override void PerformExecutions(IEventSource session) | |
{ | |
var filter = session.GetEnabledFilter("multitenancy"); | |
session.DisableFilter("multitenancy"); | |
base.PerformExecutions(session); | |
if (filter != null) | |
session.EnabledFilters.Add("multitenancy", filter); | |
} |
This file contains 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 MultitenantEntityPersister : SingleTableEntityPersister | |
{ | |
public MultitenantEntityPersister(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping mapping) | |
: base(persistentClass, cache, factory, mapping) | |
{ | |
} | |
protected override NHibernate.SqlCommand.SqlCommandInfo GenerateUpdateString(bool[] includeProperty, int j, bool useRowId) | |
{ | |
var index = base.GetPropertyIndex("TenantId"); |
This file contains 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 MultitenantAssuranceListener : IPostLoadEventListener, IPreUpdateEventListener, IPreInsertEventListener, IPreDeleteEventListener | |
{ | |
public void OnPostLoad(PostLoadEvent @event) | |
{ | |
if (@event.Entity is IHaveTenant) | |
{ | |
var tenantId = ((IHaveTenant)@event.Entity).TenantId; | |
if (Scope.CurrentTenant.Id != tenantId) | |
throw new InvalidOperationException("Ilegal data access."); | |
} |
This file contains 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 MultitenantEntityBase<T> : EntityMapBase<T> | |
{ | |
protected MultitenantEntityBase() | |
{ | |
//... | |
ApplyFilter<MultitenantFilter>(); | |
Map(a => a.TenantId).Not.Nullable(); | |
} | |
} |
NewerOlder