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 | |
# | |
# MongoDB Backup Script | |
# VER. 0.1 | |
# Note, this is a lobotomized port of AutoMySQLBackup | |
# (http://sourceforge.net/projects/automysqlbackup/) for use with | |
# MongoDB. | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
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 argparse | |
from mock import Mock | |
m = Mock() | |
parser = argparse.ArgumentParser() | |
subparsers = parser.add_subparsers() | |
query_group = subparsers.add_parser('query') | |
add_group = subparsers.add_parser('add') |
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
Last Friday, Jonathan Worthington and I (Carl Mäsak) decided to get our feet | |
wet with CQRS and event sourcing. The toy project we settled on: a simple but | |
realistic web site for two-player board games. | |
In this post, I summarize how things went. | |
## Architect meets domain expert | |
Since there were only the two of us, I took the role of the domain expert, and | |
Jonathan took the role of the architect. He expertly teased a model out of |
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 :domain, ENV["domain"] | |
set :application, domain | |
set :user, ENV["user"] | |
set :destination, ENV["destination"] || domain | |
set :web_conf, ENV["web_conf"] || ENV["environment"] || 'production' | |
raise "please set domain=app.domain.name.com" unless domain | |
raise "please set user=server_username" unless user | |
set :port, ENV["port"] || 1234 | |
set :repository, "." |
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
/* | |
author: jbenet | |
os x, compile with: gcc -o testo test.c | |
linux, compile with: gcc -o testo test.c -lrt | |
*/ | |
#include <time.h> | |
#include <sys/time.h> | |
#include <stdio.h> |
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
urlencode() { | |
# urlencode <string> | |
old_lc_collate=$LC_COLLATE | |
LC_COLLATE=C | |
local length="${#1}" | |
for (( i = 0; i < length; i++ )); do | |
local c="${1:$i:1}" | |
case $c in |
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
<?php | |
require_once dirname(__DIR__).'/../../../../app/AppKernel.php'; | |
/** | |
* Test case class helpful with Entity tests requiring the database interaction. | |
* For regular entity tests it's better to extend standard \PHPUnit_Framework_TestCase instead. | |
*/ | |
abstract class KernelAwareTest extends \PHPUnit_Framework_TestCase | |
{ |
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
# Search term parser from https://gist.github.com/1477730 | |
# Modified to allow periods (and other non-letter chars) in unquoted field values | |
# and field names. | |
# | |
# Helper class to help parse out more advanced saerch terms | |
# from a form query | |
# | |
# Note: all hash keys are downcased, so ID:10 == {'id' => 10} | |
# you can also access all keys with methods e.g.: terms.id = terms['id'] = 10 | |
# this doesn't work with query as thats reserved for the left-over pieces |
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
Notes based on Greg Young's business perspective presentation | |
http://skillsmatter.com/podcast/agile-testing/greg-young-cqrs-event-sourcing-the-business-perspective | |
With a standard structural model we make assumptions of what the business may or may not want in the future. How can we presume to know what to track and what to discard. | |
CQRS/ES benefits: | |
* Captures behaviour explicitly, events carry the intent of users. | |
* We can derive any possible model about data that may be required. | |
* Allows domain experts and users to look at today in any way they may want to. |
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
<?php | |
namespace Application\ExerciseBundle\DependencyInjection\Compiler; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | |
/** | |
* Overrides the default host for the Router's RequestContext service. | |
* |
OlderNewer