Skip to content

Instantly share code, notes, and snippets.

View maxbates's full-sized avatar

Maxwell Bates maxbates

View GitHub Profile
//simple stand-alone script to check if the blast endpoint is working, and returning results in a format that can be
// interpreted (i.e., includes RID)
// TOGGLE BETWEEN LOCAL AND NCBI
const runLocally = true;
// CHOOSE ONE QUERY (accessionVersion / Fasta)
const query = 'AL111168.1';
//const query = `> A23590235.23 My Great Gene\nACGACTGAACCTGATCATCGACACTGACTACTATCGATCGATCATGcgtcgctcgcctttcgctcgctcgctcgctgcCTACGTGCATCGATCGACTACAGAGCGCGCGCTACATTACGCGCGAGCGACGACGATCTATCGCGCGACTACTGACGATCGCGACTACGACGCA`;
@maxbates
maxbates / viriondb_cla
Created October 31, 2016 17:29
CLA for VirionDB
Thank you for your interest in the Virion DB Open Source Project (the “Project”), a project owned and hosted by Autodesk, Inc. ("Autodesk"). In order to clarify the intellectual property license granted with Contributions from any person or entity, Autodesk must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor to the Project, indicating agreement to the license terms below. This license is for your protection as a Contributor to the Project as well as the protection of Autodesk and the other Project users; it does not change your rights to use your own Contributions for any other purpose.
Please read this document carefully before signing and keep a copy for your records.
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Autodesk for use with the Project. Except for the license granted herein to Autodesk and the other Project users, You reserve all right, title, and interest in and to Your Contribut
@maxbates
maxbates / SassMeister-input.scss
Created November 13, 2014 00:18
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
$font-path: '../fonts/';
$sprite-path: '../sprites/';
$image-path : '../images/';
@function url-wrap ($root : false, $path : false, $only-path : false, $cachebust : false) {
@maxbates
maxbates / hotkeysModal.scss
Created May 22, 2014 07:49
Angular-hotkeys service is great, modal is kinda fug. This uses bootstrap instead to add just a little spice.
.hotkeyModal {
display: block;
z-index: -1000;
&.in {
background: rgba(0,0,0,0.5);
z-index: 1100;
}
table {
@maxbates
maxbates / simpleSticky.js
Created May 22, 2014 05:30
Angular sticky div -- had trouble finding one I liked, so here is a simple directive to fix a div once you scroll past it
/**
* @ngdoc directive
* @name simple-sticky
*
* @description
* Simple directive to create a sticky div, which will remain fixed relative to the top of the page.
*
* Not super efficient (is throttled, but still) so don't use too many on a page
*
* @attr simpleSticky {number} number of pixels from top
@maxbates
maxbates / jsonEdit.js
Last active August 29, 2015 13:59
Bind a textarea to a json, only propagate changes when valid... http://jsfiddle.net/maxbates/cX3Tg/
'use strict';
/*
example usage: <textarea json-edit="myObject" rows="8" class="form-control"></textarea>
jsonEditing is a string which we edit in a textarea. we try parsing to JSON with each change. when it is valid, propagate model changes via ngModelCtrl
use isolate scope to prevent model propagation when invalid - will update manually. cannot replace with template, or will override ngModelCtrl, and not hide behind facade
will override element type to textarea and add own attribute ngModel tied to jsonEditing
@maxbates
maxbates / angular-dynamic-scriptUrl.js
Last active August 29, 2015 13:57
Override the angular script directive (used for templates) with this if you need to use dynamic (e.g. interpolated or put through angular function) URLs in dynamically loaded content
angular.module('myApp')
.run(function ($rootScope) {
$rootScope.mixin = function(urls) {
if (angular.isUndefined(urls) || urls == '') {
return $q.when('no mixin url');
}
var deferred = $q.defer();
@maxbates
maxbates / bootstrapFormField.js
Last active August 29, 2015 13:55
Angular wrapper for bootstrap form elements. 1st pass - open to improvement.
angular.module('bootstrapFormField', [])
/**
* @name formField
*
* @description Wrapper for form elements, adding bootstrap classes automatically. Specifically handles according to element type, wrapping appropriately. Also adds Labels and Help blocks. Does not compile internal contents.
*
* @note The element declared as child of form-field is transcluded, ng-model delcarations will run into prototypical inheritance weirdness (i.e. if you don't declare in the form of "object.field", define as "$parent.object"). Updates to form controls within this directive will not an undefined model. Model should at least be declared as empty object.
*
* @usage Use in form on elements: input, textarea, select, etc. Not button. Should have one and only one direct child (the field element). That child may have it's own children (e.g. options in a select). If pass removable="fieldName" then will delete key sharable.fieldName. Can pass hide-label to hide label and just show the element and help, but will be overriden fo
/**
* This module monitors angularFire's authentication and performs actions based on authentication state.
*
* See usage examples here: https://gist.github.com/katowulf/7328023
*
* This fork adds support for a 'pending' state
*/
angular.module('FirebaseWaitForAuth', [])
/**