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 wmi | |
from _winreg import * | |
NETWORK_NAME = 'Local Area Connection' | |
REG_KEY = 'Software\Microsoft\Windows\CurrentVersion\Internet Settings' | |
def main(): | |
c = wmi.WMI() | |
key = OpenKey(HKEY_CURRENT_USER, REG_KEY, 0, KEY_WRITE) | |
adapter = [a for a in c.Win32_NetworkAdapter() |
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
from django.test import TestCase | |
from django.core.urlresolvers import reverse | |
from django_project.sitemaps import StaticSitemap | |
from django_project.urls import sitemaps | |
class StaticSitemapTests(TestCase): | |
def setUp(self): | |
names = [name for s in sitemaps.values() | |
if isinstance(s, StaticSitemap) |
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
SET InputFile=%SystemRoot%\System32\drivers\etc\hosts | |
SET OutputFile=%SystemRoot%\System32\drivers\etc\hoststemp | |
IF "%HOSTS_OVERRIDE%" == "" GOTO FIRST_RUN | |
IF "%HOSTS_OVERRIDE%"=="1" ( | |
SETX HOSTS_OVERRIDE 0 | |
GOTO TEST | |
) else ( | |
SETX HOSTS_OVERRIDE 1 | |
GOTO LIVE |
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
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
choco feature enable -n=allowGlobalConfirmation | |
choco install logstash --version 6.2.4 | |
choco feature disable -n=allowGlobalConfirmation | |
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") |
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
A related problem to this happens when projections start doing lookups to other projections. As example there could be a customer table managed by a CustomerProjection and an orders table managed by an OrdersProjection. Instead of having the OrdersProjection listen to customer events the decision was made to have it lookup in the CustomerProjection what the current Customer Name is to copy into the orders table. This can save time and duplication in the OrdersProjection code. | |
On a replay of only the Orders projection all of the orders will end up with the current Customer Name not the Customer Name from the time that the original order was placed. A replay will result in different results that the original. This is a tradeoff to the reduced code that was originally gained, the two projections now have a coupling. | |
In the case of sharing information the two projections can no longer be replayed independently, they instead need to be replayed as a group. It is quite easy to end up with an unmanageable web of d |
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
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
choco feature enable -n=allowGlobalConfirmation | |
choco install logstash --version 6.2.4 | |
choco feature disable -n=allowGlobalConfirmation | |
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") |
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
from datetime import datetime | |
from uuid import NAMESPACE_URL, uuid5 | |
from django.test import TransactionTestCase | |
from eventsourcing.application.decorators import applicationpolicy | |
from eventsourcing.application.django import DjangoApplication | |
from eventsourcing.application.process import ProcessApplication | |
from eventsourcing.domain.model.aggregate import BaseAggregateRoot | |
from eventsourcing.system.definition import System |