I hereby claim:
- I am edcrypt on github.
- I am edcrypt (https://keybase.io/edcrypt) on keybase.
- I have a public key whose fingerprint is AFBA B812 9AAB 1D6E F8E4 3120 718C 6D87 7DF2 FAD6
To claim this, I am signing this object:
| ( | | |
| parent* = traits clonable. | |
| balance<-0. | |
| {'Category: transfer' | |
| deposit: amount = ( balance: balance + amount ). | |
| withdraw: = ( | :amount | balance: 0 max: balance - amount ). | |
| } | |
| | ) |
| sudo apt-get install build-essential cmake libreadline-dev libssl-dev libncurses5-dev libffi-dev zlib1g-dev libpcre3-dev libpng12-dev libjpeg62-dev python-dev libpng12-dev libjpeg62-dev libmysqlclient-dev libmemcached-dev libtokyocabinet-dev libsqlite3-dev libdbi-dev libpq-dev libgmp3-dev libogg-dev libvorbis-dev libtaglib-cil-dev libtag1-dev libtheora-dev libsamplerate0-dev libloudmouth1-dev libsndfile1-dev libflac-dev libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libxmu-dev libxi-dev libxml2-dev libyajl-dev uuid-dev liblzo2-dev zlib1g-dev | |
| sudo apt-get install libevent-dev | |
| sudo apt-get install libtiff5-dev |
| import pykka | |
| class Prototype(pykka.ThreadingActor): | |
| def __init__(self, *args, **kw): | |
| import treedict | |
| self.properties = treedict.TreeDict() | |
| self.properties.pykka_traversable = True | |
| super().__init__(*args, **kw) | |
| def clone(self): | |
| new_obj = Prototype.start().proxy() | |
| new_obj.properties.attach(self.properties, copy=False).get() |
| # There are a dozen ways to implement the Prototype/Properties Pattern in Python. | |
| # | |
| # You could use copy.copy(), or program with classes and classmethods only. | |
| # for example. | |
| # | |
| # But if you want to use an existing library in this style, and don't want to loose | |
| # Python's flexibility (multiple inheritance, etc) I believe this solution works best. | |
| # | |
| # Prototypes, in Pythonic terms, are objects that behave like instances and classes/types, | |
| # unifying instantiation and inheritance. So the most obvious solution, even if wasteful, |
| #Sample code | |
| #Hello world | |
| "Hello world!" print | |
| #Factorial | |
| factorial := method(n, if(n == 1, 1, n * factorial(n - 1))) | |
| 99 bottles of beer |
I hereby claim:
To claim this, I am signing this object:
| clear lock | |
| clear control | |
| clear mod1 | |
| clear mod2 | |
| clear mod3 | |
| clear mod4 | |
| clear mod5 | |
| keycode 37 = Hyper_L | |
| keycode 66 = Control_L | |
| add control = Control_L Control_R |
| ;; Fortune on scratch buffer | |
| ;; Add this to your ~/.emacs.d/init.el | |
| (require 'fortune) | |
| (setq fortune-dir "/usr/local/Cellar/fortune/9708/share/games/fortunes/") | |
| (setq fortune-file "/usr/local/Cellar/fortune/9708/share/games/fortunes/") | |
| (setq fortune-program "/usr/local/bin/fortune") | |
| ;; next two funcs from http://datko.net/2013/07/08/slight-enhancement-to-fortune-el/ | |
| (defun fortune-message (&optional file) | |
| "Display a fortune cookie to the mini-buffer. |
| function fish_greeting --description "Greet the user with the shell's version, and a complementary colorful cow." | |
| set_color --bold; fish -v; set_color normal | |
| set cows cowsay\ {-b,-d,-g,-p,-s,t,-w,-y} | |
| set chosen_cow_index (math (random)%8+1) | |
| set chosen_cow $cows[$chosen_cow_index] | |
| fortune -a -s | eval $chosen_cow | lolcat | |
| end |