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
// In a StructureMap registry somewhere (for us, it's in CoreRegistry.cs) | |
For<IObjectConverter>().Use<DovetailObjectConverter>(); | |
// In another file, we set up some of our conversions and conversion families | |
public class DovetailObjectConverter : ServiceEnabledObjectConverter | |
{ | |
public DovetailObjectConverter(IServiceLocator locator) | |
: base(locator) | |
{ |
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 EntityModelBinder : IModelBinder | |
{ | |
private static readonly TypeConverter _converter = TypeDescriptor.GetConverter(typeof (Guid)); | |
public bool Matches(Type type) | |
{ | |
return type.CanBeCastTo<DomainEntity>(); | |
} |
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
/* Prelude.cs : What happens when a haskell programmer learns C#. | |
Copyright (c) 2011 Clark Gaebel | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the "Software"), | |
to deal in the Software without restriction, including without limitation | |
the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
and/or sell copies of the Software, and to permit persons to whom the | |
Software is furnished to do so, subject to the following conditions: |
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
jBus.routing = new (function() { | |
function lazy(builder) { | |
this.builder = builder; | |
this.buildWith = function(func) { | |
this.builder = func; | |
}; | |
this.value = function() { | |
return this.builder(); | |
}; |
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
import scala.collection.mutable.ListBuffer | |
import akka.actor.{Actor,ActorRef} | |
import akka.actor.Actor._ | |
import akka.routing.{ Listeners, Listen } | |
//Represents a domain event | |
trait Event | |
//A builder to create domain entities | |
trait EntityBuilder[Entity] { |
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
import akka.actor._ | |
import akka.persistence._ | |
object EventsourcingExample extends App { | |
class EventsourcedProcessor extends Processor { | |
var events: List[Any] = Nil | |
var awaitStack: List[Actor.Receive] = Nil | |
def receive = { | |
case Persistent(event, _) if recoveryRunning ⇒ update(event) |
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
#don't send the nginx version number in error pages and Server header | |
server_tokens off; | |
# config to enable HSTS(HTTP Strict Transport Security) https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security | |
# to avoid ssl stripping https://en.wikipedia.org/wiki/SSL_stripping#SSL_stripping | |
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; | |
# config to don't allow the browser to render the page inside an frame or iframe | |
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking | |
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri |
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
#Download Elementary OS from here: | |
#http://sourceforge.net/projects/elementaryos/files/stable/ | |
#First you update your system | |
sudo apt-get update && sudo apt-get dist-upgrade | |
#Clean-up System | |
sudo apt-get purge noise | |
sudo apt-get purge software-center | |
sudo apt-get purge scratch-text-editor |
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
#!/bin/bash | |
# An alternative to "links", run this script after starting or stopping any | |
# container. It's a hack to update the host machine (vagrant) /etc/hosts with | |
# the current active docker containers and tell dnsmasq to refresh. | |
# | |
# Then start each machine with "-dns ${DOCKER_HOST_IP}", e.g. | |
# $ docker run -d -name mycontainer1 -dns 10.0.3.1 MYPRODUCT | |
# You can't seem to set the DNS during "docker build". | |
# | |
# Diagnostic command to run in host or while logged into containers: |
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
$packages = [ 'curl', 'terminator', 'jdk7-openjdk', 'chromium', 'virtualbox', 'git', 'zsh', 'networkmanager', 'network-manager-applet', 'ttf-dejavu', 'arandr', | |
'openssh', 'nm-applet', 'xscreensaver', 'volwheel' ] | |
$yaourtPackages = [ 'vagrant', 'sublime-text', 'dropbox', 'oh-my-zsh-git', 'intellij-idea-13-community', 'kalu' ] | |
$services = [ 'NetworkManager' ] | |
$stoppedServices = [ 'netctl' ] | |
package { $packages: |
OlderNewer