made with esnextbin
--- | |
# 1) Be sure to set the following variables for all hosts: | |
# vars: | |
# oldsshport: 22 | |
# sshport: 555 | |
# 2) Might fail without setting remote_tmp = /tmp/ansible/$USER in your ansible.cfg. Includes a fix for this setting below. | |
# 3) Once host is setup most of the checks are skipped and works very quickly. | |
# 4) Be sure to set non-standard shells in a different playbook later. Stick with /bin/bash until you can run apt install. | |
# 5) Assumes root user has sshkey setup already. Not sure how to utilize the --ask-pass option. For now, use ssh-copy-id prior to running playbook on new host for root user (if needed). |
### *** Contains some Ubuntu-specific commands/packages. Modify accordingly. *** | |
### | |
# scripts/ansible.sh | |
### | |
#!/usr/bin/env bash | |
# Ansible dependencies |
/** | |
* Parses mixed type values into booleans. This is the same function as filter_var in PHP using boolean validation | |
* @param {Mixed} value | |
* @param {Boolean} nullOnFailure = false | |
* @return {Boolean|Null} | |
*/ | |
var parseBooleanStyle = function(value, nullOnFailure = false){ | |
switch(value){ | |
case true: | |
case 'true': |
var Promise = require('bluebird'); | |
var promiseWhile = function(condition, action) { | |
var resolver = Promise.defer(); | |
var loop = function() { | |
if (!condition()) return resolver.resolve(); | |
return Promise.cast(action()) | |
.then(loop) | |
.catch(resolver.reject); |
// NOTE: I previously suggested doing this through Grunt, but had plenty of problems with | |
// my set up. Grunt did some weird things with scope, and I ended up using nodemon. This | |
// setup is now using Gulp. It works exactly how I expect it to and is WAY more concise. | |
var gulp = require('gulp'), | |
spawn = require('child_process').spawn, | |
node; | |
/** | |
* $ gulp server | |
* description: launch the server. If there's a server already running, kill it. |
/* iPhone 2G-4S (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Styles */ | |
} | |
/* Smartphones (landscape) ----------- */ | |
@media only screen | |
and (min-width : 321px) { |
<!-- Raven.js Config --> | |
<script src="{{ JS_PATH }}/lib/raven.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
// Ignore list based off: https://gist.github.com/1878283 | |
var ravenOptions = { | |
// Will cause a deprecation warning, but the demise of `ignoreErrors` is still under discussion. | |
// See: https://github.com/getsentry/raven-js/issues/73 | |
ignoreErrors: [ | |
// Random plugins/extensions | |
'top.GLOBALS', |
function createStore (reducers) { | |
var state = reducers() | |
const store = { | |
dispatch: (action) => { | |
state = reducers(state, action) | |
}, | |
getState: () => { | |
return state | |
} | |
} |
Access to Ameritrade API
notes that may be helpful for node.js devs
What I've gathered is authorization tokens must be earned first. Authorization tokens are good for three months, once you are setup, you will get two tokens which come as long strings, An access_token and a refresh_token. Access tokens are only valid for 30 minutes so you will need to code to refresh the session using the refresh token frequently. When you refresh, you are given a new access token and that is what you use to "login" or pull from the api for the next period. But in order to get the tokens, you will be required to go through some processes to get a valid token that applies to your app. The following text kind of steers you in that direction...
Making an app
On the api site you will need to make an app, where you pick some random name by using some random numbers. It should be automatically generated but it isnt. For this field item, I simply went to https://www.uuidgenerator.net/ and just grabbed the first