This file contains hidden or 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
| # Preprocessing: Convert '--' to 0 | |
| number_re = re.compile(r'\s?--') | |
| str2float = lambda x: x if np.isreal(x) else number_re.sub('0', x, re.U) | |
| data[key] = data[key].map(str2float).astype(float) | |
This file contains hidden or 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
| # http://stackoverflow.com/questions/8915296/python-image-library-fails-with-message-decoder-jpeg-not-available-pil | |
| # Jpeg support | |
| brew install libjpeg | |
| # Install PIL | |
| sudo RCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install PIL --allow-external PIL --allow-unverified PIL |
This file contains hidden or 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
| # Generate ssh key with your email | |
| ssh-keygen -t rsa -C "[email protected]" | |
| # For github: Add your key to github | |
| # For heroku: type the command | |
| heroku keys:add | |
| heroku keys # list your keys | |
| # List your added ssh keys | |
| ssh-add -l |
This file contains hidden or 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
| # alias | |
| alias ls='ls -hBG' | |
| alias ll='ls -lAhBG' | |
| alias pyserver='python -m SimpleHTTPServer 8888' | |
| export LSCOLORS=ExGxBxDxCxEgEdxbxgxcxd | |
| alias emacs='/usr/local/Cellar/emacs/HEAD/bin/emacsclient' | |
| alias startemacs='/Applications/Emacs.app/Contents/MacOS/Emacs' | |
| export GIT_EDITOR="subl --wait --new-window" |
This file contains hidden or 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
Show hidden characters
| { | |
| "cmd": ["nosetests", "-s", "$file"], | |
| "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", | |
| "selector": "source.python", | |
| "working_dir": "/Users/bun/Documents/<project_dir>", | |
| "path" : "/usr/local/bin" | |
| } |
This file contains hidden or 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
| brew install gcc | |
| brew install freetype #for matplotlib |
This file contains hidden or 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
| <!DOCTYPE HTML> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>App</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | |
| <script charset="utf-8" src="js/app.js"></script> | |
| <link rel="stylesheet" href="css/app.css" /> | |
| </head> | |
| <body> |
This file contains hidden or 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
| Interacting with data stores: | |
| - Restful API access | |
| - Local storage | |
| Rendering data to ui: Views | |
| Models: | |
| - Represent your data: POJO | |
| - Read/write properties on the data | |
| - Persist data to the server | |
| - Responding to user interaction/ | |
| event listeners that fire when data changes |
This file contains hidden or 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
| .smile { | |
| position: absolute; | |
| top: 0; | |
| left: 60%; | |
| width: 100px; | |
| height: 100px; | |
| margin-left: -50px; | |
| } | |
| @-webkit-keyframes circle { |
This file contains hidden or 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
| To support HTML highlighting of underscore/handlebar/html templates in Sublime Text 2: | |
| Sublime > Preferences > Browse Packages... | |
| Open HTML > HTML.tmLanguage | |
| Line 286: | |
| Comment: | |
| <!-- <string>(?:^\s+)?(<)((?i:script))\b(?![^>]*/>)</string> --> | |
| Add: | |
| <string>(?:^\s+)?(<)((?i:script))\b(?![^>]*/>)(?!.*type=["']text/*.(template|html)['"])</string> |