Skip to content

Instantly share code, notes, and snippets.

View ccll's full-sized avatar

Cai Lei ccll

  • Beijing, China
View GitHub Profile
@ccll
ccll / gist:faabd63a32296726dd0a505c611d379d
Created October 20, 2023 12:26 — forked from SzymonPobiega/gist:5220595
DDD/CQRS/ES/Architecture videos

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):

  1. Eric Evans' [What I've learned about DDD since the book]{http://www.infoq.com/presentations/ddd-eric-evans}
  2. Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
  5. Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
  6. Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht
@ccll
ccll / settings.py
Created October 28, 2022 07:00 — forked from andreagrandi/settings.py
Sending emails from Django during development without using a real SMTP server. Python comes with a very basic and integrated SMTP server. To start it just open a terminal and type: python -m smtpd -n -c DebuggingServer localhost:1025 Then configure your settings.py using the following parameters. You will see the email directly in the terminal …
if DEBUG:
EMAIL_HOST = 'localhost'
EMAIL_PORT = 1025
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_TLS = False
DEFAULT_FROM_EMAIL = '[email protected]'
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using \ and -
bind \ split-window -h
bind - split-window -v
unbind '"'
unbind %
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using \ and -
bind \ split-window -h
bind - split-window -v
unbind '"'
unbind %
@ccll
ccll / gist:f0941eafd01fe131d24d
Created October 4, 2015 15:08 — forked from LearnCocos2D/gist:77f0ced228292676689f
Overview of Entity Component System (ECS) variations with pseudo-code

For background and further references see: Entity Component Systems on Wikipedia

ECS by Scott Bilas (GDC 2002)

Entity->Components->Update
  • entity = class: no logic + no data OR at most small set of frequently used data (ie position)
  • component = class: logic + data
foreach entity in allEntities do
    foreach component in entity.components do
@ccll
ccll / .gitconfig.user
Created March 27, 2015 05:09
p4merge for 'git mergetool'
[diff]
tool = p4merge
[merge]
tool = p4merge
[difftool "p4merge"]
cmd = ~/bin/p4merge \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "p4merge"]
@ccll
ccll / docker-ip
Created March 9, 2015 06:28
Get IP address of docker container
docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${CID}
@ccll
ccll / .clang-format
Created March 7, 2015 04:26
clang-format config file
---
Language : Cpp
BasedOnStyle : LLVM
AccessModifierOffset : -2
ConstructorInitializerIndentWidth : 4
AlignEscapedNewlinesLeft : false
AlignTrailingComments : true
AllowAllParametersOfDeclarationOnNextLine : true
AllowShortBlocksOnASingleLine : false
AllowShortIfStatementsOnASingleLine : false
@ccll
ccll / git-my-squash
Last active August 29, 2015 14:10
[git] Squash current feature branch in-place (from the last fork point to the tip of current branch)
#!/bin/bash
base=$1
if [ "$base" == "" ]; then
echo "Please specify a base branch"
echo "Usage: git squash <base branch>"
echo ""
echo "<base branch>: the branch where your current branch forked off (normally it's 'master')"
exit 1