It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
| from datetime import datetime | |
| import numpy as np | |
| import talib | |
| import alpaca_trade_api as tradeapi | |
| api = tradeapi.REST(key_id=<your key id>,secret_key=<your secret key>) | |
| barTimeframe = "1H" # 1Min, 5Min, 15Min, 1H, 1D | |
| assetsToTrade = ["SPY","MSFT","AAPL","NFLX"] | |
| positionSizing = 0.25 |
| //1. Set up your Mandrill credentials | |
| keystone.init({ | |
| // ... | |
| 'mandrill api key': 'YOUR_API_KEY_HERE', | |
| // ... | |
| 'emails': 'templates/emails', | |
| }); | |
| //or alternatively, you can set the key later | |
| keystone.set('mandrill api key', 'YOUR_API_KEY_HERE'); |
| .link { | |
| //desktop styles | |
| color: $color-brand-white; | |
| &:hover { | |
| color: $color-brand-red; | |
| } | |
| //overwrite for touch - uses modernizr to overwrite link pseudo classes | |
| .touch &:link, |
| #!/bin/bash | |
| # node-reinstall | |
| # credit: http://stackoverflow.com/a/11178106/2083544 | |
| ## program version | |
| VERSION="0.0.13" | |
| ## path prefix | |
| PREFIX="${PREFIX:-/usr/local}" |
This is an example of how to scaffold API endpoints to list / get / create / update / delete Posts in a Keystone website.
It's a modification of the default project created with the yo keystone generator (see https://github.com/JedWatson/generator-keystone)
Gists don't let you specify full paths, so in the project structure the files would be:
routes-index.js --> /routes/index.js // modified to add the api endpoints
routes-api-posts.js --> /routes/api/posts.js // new file containing the Post API route controllers
| <!doctype html> | |
| <html> | |
| <title>Flatten.js, General SVG Flattener</title> | |
| <head> | |
| <script> | |
| /* | |
| Random path and shape generator, flattener test base: https://jsfiddle.net/fjm9423q/embedded/result/ | |
| Basic usage example: https://jsfiddle.net/nrjvmqur/embedded/result/ |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist.
Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).