Skip to content

Instantly share code, notes, and snippets.

View .tmux.conf
# 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 %
View gist:7a78fd35963abaa4cac8707577d233a9
# 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 Oct 4, 2015 — forked from LearnCocos2D/gist:77f0ced228292676689f
Overview of Entity Component System (ECS) variations with pseudo-code
View gist:f0941eafd01fe131d24d

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 Mar 27, 2015
p4merge for 'git mergetool'
View .gitconfig.user
[diff]
tool = p4merge
[merge]
tool = p4merge
[difftool "p4merge"]
cmd = ~/bin/p4merge \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "p4merge"]
@ccll
ccll / docker-ip
Created Mar 9, 2015
Get IP address of docker container
View docker-ip
docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${CID}
@ccll
ccll / .clang-format
Created Mar 7, 2015
clang-format config file
View .clang-format
---
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 Aug 29, 2015
[git] Squash current feature branch in-place (from the last fork point to the tip of current branch)
View git-my-squash
#!/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