Skip to content

Instantly share code, notes, and snippets.

☕️
Writing code

Cory Reed swashcap

☕️
Writing code
Block or report user

Report or block swashcap

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@swashcap
swashcap / coinstac-server-client.js
Created Jan 25, 2016
nodeapi/coinstac-server-core integration
View coinstac-server-client.js
// coinstac-server-client/index.js
'use strict';
var assign = require('lodash.assign');
var Pouchy = require('pouchy');
module.exports.handlersFactory = function(config) {
// Private, configured PouchDB/Pouchy instance
// May need async config of instance if it's Cloudant and security settings
@swashcap
swashcap / base.js
Last active Feb 5, 2016
Thin JOI Classes
View base.js
/**
* @module base.js - COINSTAC Model
*/
'use strict';
const assign = require('lodash/assign');
const joi = require('joi');
const pick = require('lodash/pick');
/**
View freesurfer-multishot.js
'use strict';
const _ = require('lodash');
const coinstacCommon = require('coinstac-common');
const coinstacAlgorithms = require('coinstac-distributed-algorithm-set');
const freesurferParser = require('freesurfer-parser');
const helpers = require('./path/to/helpers/');
const Analysis = coinstacCommon.Analysis;
const ComputationPipeline = coinstacCommon.ComputationPipeline;
@swashcap
swashcap / cli
Created Feb 15, 2016
Node’s Uncaught Exception
View cli
#!/usr/bin/env node
'use strict';
const logger = require('../src/utils/logger.js');
const pkg = require('../package.json');
const program = require('commander');
const server = require('../index.js').server;
const url = require('url');
@swashcap
swashcap / pick-ordered-values.js
Created Apr 4, 2016
Pick ordered values snippet
View pick-ordered-values.js
/**
* Pick ordered values.
*
* @example
* pickOrderedValues(
* ['wat', 'silly'],
* { silly: 100, thing: 200, wat: 300 }
* );
* // => [300, 100]
*
@swashcap
swashcap / instructions.md
Last active Jun 3, 2016
Directory Parsing Exercise
View instructions.md
View issue.md

We’re considering changing the object shape for a simulator declaration (declaration.js in Sergey’s examples). Right now it looks like this:

const path = require('path');

module.exports = {
  users: [{
    username: 'user1',
    userData: [
      // Data here...
@swashcap
swashcap / makeTree.js
Last active Nov 1, 2016
Make a tree from a flat data structure
View makeTree.js
'use strict';
const { deepEqual } = require('assert');
/**
* Sample data structure.
*
* The items are roughly sorted already, with the top-level item as the root of
* the tree.
*
@swashcap
swashcap / gulpfile.js
Last active Nov 23, 2016
Gulpifying Jekyll
View gulpfile.js
/* global -$ */
'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var browserSync = require('browser-sync');
var reload = browserSync.reload;
gulp.task('styles', function () {
return gulp.src('app/css/main.scss')
View vagrant-debug.txt
$ vagrant up --debug
INFO global: Vagrant version: 1.8.7
INFO global: Ruby version: 2.2.5
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_LOG="debug"
INFO global: VAGRANT_OLD_ENV_PS1="\\w$ "
INFO global: VAGRANT_OLD_ENV_TERM="xterm-256color"
INFO global: VAGRANT_OLD_ENV_NVM_DIR="/Users/creed/.nvm"
INFO global: VAGRANT_OLD_ENV_NODE_ENV="development"
INFO global: VAGRANT_OLD_ENV_SHLVL="1"
You can’t perform that action at this time.