Set these under iTerm2 > Preferences > Keys
control + d
Send Text with "vim" Special Chars
to
file=/data/asciinema/sa-2-fullstack; rm -f ${file}; asciinema rec ${file} -i 2 -t "title_here" |
#!/usr/bin/env python | |
import pandas as pd | |
df = pd.DataFrame([ | |
{ | |
'date': '2019-01-01 14:30:00', | |
'epochms': 1546353000000 | |
}, | |
{ |
alias t='pushd /opt/sa && source /opt/venv/bin/activate && py.test --maxfail=1 && flake8 . && pycodestyle . && popd' | |
alias lsprice='source /opt/venv/bin/activate && aws --endpoint-url http://localhost:9000 s3 ls s3://pricing' | |
alias lsbucket='source /opt/venv/bin/activate && aws --endpoint-url http://localhost:9000 s3 ls' | |
use_aws() { | |
export S3_ACCESS_KEY=ACCESS | |
export S3_SECRET_KEY=SECRET | |
export S3_ADDRESS=s3.us-east-1.amazonaws.com | |
export S3_BUCKET=BUCKET_NAME | |
export S3_REGION_NAME=us-east-1 |
Hopefully this will answer "How do I setup or start a Django project?" I was trying to set up my own website, and there was a lot to read, learn and digest! Therefore, I put this together which is a collection of all the guides/blog posts/articles that I found the most useful. At the end of this, you will have your barebones Django app configured and ready to start building :)
NOTE: This guide was built using Django 1.9.5, NodeJS 4+ with NPM 3+
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.path)
['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']
>>>
jay@dev:~$ python3
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
import pandas as pd | |
from analysis_engine.algo import EquityAlgo | |
ticker = 'SPY' | |
demo_algo = EquityAlgo( | |
ticker=ticker, | |
balance=1000.00, | |
commission=6.00, | |
name='test-{}'.format(ticker)) | |
date_key = '{}_2018-11-05'.format( | |
ticker) |
#!/usr/bin/env python | |
import pytz | |
import zipline | |
import datetime | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import analysis_engine.extract as extract | |
from collections import OrderedDict | |
from zipline.api import order |
import os | |
import sys | |
from unittest.mock import MagicMock | |
from recommonmark.parser import CommonMarkParser | |
from pprint import pprint | |
on_rtd = os.getenv("READTHEDOCS", "") != "" | |
# Using working source code sphinx conf.py on read the docs: | |
# https://github.com/mahmoud/boltons/blob/master/docs/conf.py#L20 |
function sl() { | |
use_namespace="default" | |
pod_name=$(kubectl get pods -n ${use_namespace} | awk '{print $1}' | grep api | head -1) | |
kubectl exec -it \ | |
${pod_name} \ | |
-n ${use_namespace} \ | |
-- bash -c ". /opt/venv/bin/activate && sp -q 'index=\"antinex\" AND ${@}' -u trex -p 123321 -i antinex -a splunk-svc:8089 | grep -v urllib3.connectionpool" | |
# -- bash -c ". /opt/venv/bin/activate && echo \"sp -q 'index=\"antinex\" AND ${@}' -u trex -p 123321 -a splunk-svc:8089 | grep -v urllib3\" && sp -q '${@}' -u trex -p 123321 -i antinex -a splunk-svc:8089 | grep -v urllib3.connectionpool" | |
} |