- master branch is always deployable.
- Cut a new branch off master whenever working on something new.
- When you're ready, either merge the feature branch back into master or make a PR if you want your code reviewed.
- Commit and push often.
- Source code is always open-sourceable (i.e., do not commit API keys, private keys, etc).
- API keys: use environment variables (set them in
.bashrc
or.zshrc
). - Private keys: ignore using
.gitignore
.
- API keys: use environment variables (set them in
- Always write tests. If possible, make the tests as comprehensive as possible. Otherwise, treat them as sanity tests (i.e., to make sure nothing is obviously broken).
- Whenever a bug is discovered, write test for it before fixing it (i.e., practice TDD when shit hits the fan).
- Use only the seven default actions (
index
,new
,create
,show
,edit
,update
,destroy
) in controllers. DHH.
I hereby claim:
- I am yihangho on github.
- I am yihangho (https://keybase.io/yihangho) on keybase.
- I have a public key whose fingerprint is 4BE3 D8D2 3DEA BEE9 6E0B 6BA4 E71E 9BF2 FD9A 6A84
To claim this, I am signing this object:
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
def successor((x,y),X,Y): | |
return set([ | |
(0,y), # empty X | |
(x,0), # empty Y | |
(X,y), # fill X | |
(x,Y), # fill Y | |
(0,y+x) if x+y<=Y else (x-(Y-y), y+(Y-y)), # X->Y | |
(x+y,0) if x+y<=X else (x+(X-x), y-(X-x)), # Y->X | |
]) - set([(x,y)]) # remove self |
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
#ifdef DEBUG | |
#define debug printf("Debug: ");printf | |
#else | |
#define debug // | |
#endif | |
#include <cstdio> | |
int main() | |
{ |