python-3.6.2
- you might need to add Github to known hosts: https://stackoverflow.com/a/29380765/5405197
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
- Config your github credentials:
def execute_trade(context,data): | |
""" | |
Execute orders according to our schedule_function() timing. | |
Part of the Austrian Quant blog post: https://blog.tomiwa.ca/austrian-quant/ | |
Control + F "wordpress" to find the relevant part in the blog post. | |
""" | |
prices = data.history(assets = context.stocks, bar_count = context.historical_bars, frequency='1d', fields='price') | |
for stock in context.stocks: |
function prettifyKeys(rawKey) { | |
return toTitleCase(rawKey.replace(/_/g, ' ' )); | |
} | |
function toTitleCase(str) { | |
var i, j, lowers, uppers; | |
str = str.replace(/([^\W_]+[^\s-]*) */g, function(txt) { | |
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); |
""" | |
This is a template algorithm on Quantopian for you to adapt and fill in. | |
@author: Tomiwa Ademidun | |
@souce: https://github.com/ademidun/austrian-quant/blob/89593c86935ce08937aca79347902a7f93dee279/quantopian/speculation_fund.py | |
""" | |
from sklearn.linear_model import LogisticRegression | |
from sklearn.svm import SVC, LinearSVC, NuSVC | |
from sklearn.ensemble import RandomForestClassifier |
python-3.6.2
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
setTimeout( () => { | |
$( "#name-title" ).html( "<h1>🔥</h1>" ); | |
}, 2000); |
# Use this code snippet in your app. | |
# If you need more information about configurations or implementing the sample code, visit the AWS docs: | |
# https://aws.amazon.com/developers/getting-started/python/ | |
import boto3 | |
import base64 | |
from botocore.exceptions import ClientError | |
def get_secret(): |
#source: https://stackoverflow.com/a/1920585/5405197 | |
# With Python 2.6+ you can just do: | |
echo '{"foo": "lorem", "bar": "ipsum"}' | python -m json.tool | |
#or, if the JSON is in a file, you can do: | |
python -m json.tool my_json.json | |
#if the JSON is from an internet source such as an API, you can use |
# use this if you want to delete a specific number of entries | |
# https://stackoverflow.com/questions/13248593/django-database-delete-specific-number-of-entries | |
HomeImage.objects.filter(pk__in=HomeImage.objects.filter(ImageVectors={}).values_list('pk')[:5000])#.delete() |
<iframe src="//www.youtube.com/embed/_youtube_id_" width="560" height="315" frameborder="0" | |
allowfullscreen="allowfullscreen"> | |
</iframe> | |
<iframe class="i-amphtml-fill-content" style="z-index: 0; width: 500px; height: 200px;" | |
src="https://open.spotify.com/embed/show/0m74ZmCPgjvp5WGOMg3P9C#amp=1" | |
name="amp_iframe0" width="src=" frameborder="0" sandbox="allow-scripts allow-same-origin"> | |
</iframe> |
# Rename File Extensions | |
# https://www.maketecheasier.com/rename-files-in-linux/ | |
brew install rename; | |
rename 's/.m4a/.mp3/' * # rename all .m4a files to .mp3 (don't forget to include the asteriks '*') | |
# delete all files with a certain extension | |
# https://askubuntu.com/questions/377438/how-can-i-recursively-delete-all-files-of-a-specific-extension-in-the-current-di | |
find . -name "*.bak" -type f #first check the files that will be deleted | |
find . -name "*.bak" -type f -delete # then you can delete them |