Skip to content

Instantly share code, notes, and snippets.

Jay jay-johnson

Block or report user

Report or block jay-johnson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View location: etc_sysconfig_network-scripts - ifcfg-eno1
DEVICE=eno1
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
View use system for libvirt.sh
export LIBVIRT_DEFAULT_URI="qemu:///system"
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
View iTerm2 settings for page up and down and front of line and end of line in vim.md

Set these under iTerm2 > Preferences > Keys

Vim Page Down

control + d

Send Text with "vim" Special Chars

to

View Asciinema Command Example
file=/data/asciinema/sa-2-fullstack; rm -f ${file}; asciinema rec ${file} -i 2 -t "title_here"
@jay-johnson
jay-johnson / convert_date_columns_from_UTC_to_EST_dates.py
Last active Jan 3, 2019
Pandas Convert Date Column From UTC to EST dates
View convert_date_columns_from_UTC_to_EST_dates.py
#!/usr/bin/env python
import pandas as pd
df = pd.DataFrame([
{
'date': '2019-01-01 14:30:00',
'epochms': 1546353000000
},
{
@jay-johnson
jay-johnson / Python 2 vs Python 3 sys.path - things to check when a user has an "alias python" set in bash, sh, zsh profile.md
Created Nov 14, 2018
Python 2 vs Python 3 sys.path - things to check when a user has an "alias python" set in bashrc/shell profile
View Python 2 vs Python 3 sys.path - things to check when a user has an "alias python" set in bash, sh, zsh profile.md
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) 
@jay-johnson
jay-johnson / run-equity-algorithm-using-the-stock-analysis-engine.py
Created Nov 8, 2018
Run an Equity Algorithm using the Stock Analysis Engine
View run-equity-algorithm-using-the-stock-analysis-engine.py
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)
@jay-johnson
jay-johnson / run_daily_with_zipline.py
Last active Nov 4, 2018
SPY - stock analysis engine with Quantopian zipline run_algorithm with portfolio and benchmark using matplotlib
View run_daily_with_zipline.py
#!/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
@jay-johnson
jay-johnson / conf.py
Created Oct 10, 2018
read the docs - sphinx conf.py for finding source code from the docs path - example code block from https://stock-analysis-engine.readthedocs.io/en/latest/README.html#
View conf.py
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
You can’t perform that action at this time.