Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh -e
# DOTFILES Files that will be installed by this script.
# DOTFILES_DEPS Files that should be installed via the systems package
# manager prior to installing the dotfiles. Currently only
# dnf is supported.
# DOTFILES_DESTDIR Directory to install the dotfiles to.
# Default: $HOME
# DOTFILES_CONFDIR Directory where this script will store stuff like backups
# and a list of previously installed files.
@chrisblossom
chrisblossom / README.md
Last active April 29, 2020 17:33 — forked from snowkidind/README.md
TDAmeritrade API Notes for Node.js

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

@chrisblossom
chrisblossom / mini-redux.js
Created November 10, 2016 15:55 — forked from MarcoWorms/mini-redux.js
Redux in a nutshell
function createStore (reducers) {
var state = reducers()
const store = {
dispatch: (action) => {
state = reducers(state, action)
},
getState: () => {
return state
}
}
@chrisblossom
chrisblossom / raven-config.html
Created October 7, 2016 12:21 — forked from impressiver/raven-config.html
Raven.js configuration for logging JavaScript exceptions to Sentry (https://getsentry.com/). Without the added ignore options, you'll quickly find yourself swamped with unactionable exceptions due to shoddy browser plugins and 3rd party script errors.
<!-- 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',
/* 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) {
@chrisblossom
chrisblossom / esnextbin.md
Last active May 4, 2016 14:53
esnextbin sketch
@chrisblossom
chrisblossom / Gulpfile.js
Created January 28, 2016 18:03 — forked from webdesserts/Gulpfile.js
Automatically reload your node.js app on file change with Gulp (https://github.com/wearefractal/gulp).
// 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.
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);
/**
* 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':
@chrisblossom
chrisblossom / gist:8979722
Last active July 16, 2017 06:53
Packer Ansible-from-git-checkout Provisioner
### *** Contains some Ubuntu-specific commands/packages. Modify accordingly. ***
###
# scripts/ansible.sh
###
#!/usr/bin/env bash
# Ansible dependencies