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
git checkout -b new_branch | |
git push origin new_branch | |
git branch --set-upstream-to=origin/new_banch new_brach |
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
user=> (def d {:a 1 :b 2 :c 3}) | |
#'user/d | |
user=> (:b d) | |
2 | |
user=> (d :b) | |
2 |
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
;; After https://gist.github.com/jjconti/054e15b5a9a07ecadf33 | |
user=> (def d {:a 1 :b 2 :c 3}) | |
#'user/d | |
user=> (:b d) | |
2 | |
user=> (d :b) | |
2 | |
;; Can dictionaries be keys in another dictionary? | |
;; What if two dictionaries have each other as keys? |
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
>>> class A(object): | |
... pass | |
... | |
>>> import pickle | |
>>> from cStringIO import StringIO | |
>>> src = StringIO() | |
>>> p = pickle.Pickler(src) | |
>>> p.dump(A()) | |
>>> datastream = src.getvalue() | |
>>> dst = StringIO(datastream) |
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
# SNAKES GAME | |
# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting | |
import curses | |
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN | |
from random import randint | |
curses.initscr() | |
win = curses.newwin(20, 60, 0, 0) |