Skip to content

Instantly share code, notes, and snippets.

@cdaringe
cdaringe / coins-validate-install-ok
Created March 7, 2016 20:37
coins-validate-install-ok
🛰 cdieringer:~/node/dummy$ npm i --save-dev coins-validate
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
-
> [email protected] install /Users/cdieringer/node/dummy/node_modules/coins-validate/node_modules/git-validate
> node bin/install
> [email protected] install /Users/cdieringer/node/dummy/node_modules/coins-validate
@cdaringe
cdaringe / index.js
Created February 19, 2016 07:02
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
View = require('ampersand-input-view');
var TextAreaView = View.extend({
template: [
'<label>',
'<textarea>',
'<span data-hook="label"></span>',
'<div data-hook="message-container" class="message message-below message-error">',
'<p data-hook="message-text"></p>',
@cdaringe
cdaringe / spawn-ENOTDIR-different-results-based-on-env.js
Created February 19, 2016 06:33
`spawn` handles ENOTDIR differently based on ENV
osx =>
```js
cdieringer@Snapper-osx:~/node/coinstac-common$ node -v
v4.2.4
cdieringer@Snapper-osx:~/node/coinstac-common$ node debug test/
< Debugger listening on port 5858
...
break in src/models/computation/command.js:35
33 cmd = spawn(this.cmd, this.args, { cwd: this.cwd });
34 } catch (err) {
@cdaringe
cdaringe / cli
Last active February 15, 2016 22:33 — forked from swashcap/cli
Node’s Uncaught Exception
#!/usr/bin/env node
'use strict';
const program = require('commander');
const server = require('../index.js').server;
const url = require('url');
const config = {};
@cdaringe
cdaringe / naught-or-nice-component.js
Created January 25, 2016 23:52
naught-or-nice-component.js
import React from 'react';
import { Input, ButtonToolbar, Button } from 'react-bootstrap';
import _ from 'lodash';
export default class FormProjectContext extends React.Component {
setAnalysis(evt) {
const { dispatch, setAnalysis } = this.props;
const matches = consortium.analyses.filter(sis => sis._id === evt.target.value);
dispatch(setAnalysis(matches[0]));
@cdaringe
cdaringe / webpack-external-regex-use-node-require.js
Created December 29, 2015 17:36
webpack-external-regex-use-node-require.js
var getExternals = function() {
var internals = [/react/]; // assert that all of these entries remain in webpack bundle
var externals = [];
var externalsHash = {
fs: 'commonjs fs',
ipc: 'commonjs ipc',
remote: 'commonjs remote',
path: 'commonjs path',
config: 'commonjs config',
os: 'commonjs os',
@cdaringe
cdaringe / bambam.sh
Created December 5, 2015 03:17
bambam
#!/bin/bash
function bamtest {
tmpdir=`mktemp -d`
trap 'rm -rf "$tmpdir"' exit
PATH="$tmpdir:$PATH"
echo $PATH
ln -s "ls" "$tmpdir"/bam
echo `ls -al $tmpdir`
echo `bam` # <== hmm, not being executed, what gives?
}
@cdaringe
cdaringe / coinstac-api-via-websockets.js
Created November 24, 2015 22:32
coinstac-api-via-websockets
/**
* server API is imported into main thread as a lib
* coinstac render process or test processes can import the API, which
* exports server behaviors, and client functions to call
*/
// in main thread
var copperwad = require('copperwad'); // because we don't believe in boring names
copperwad.listen('1492');
copperwad.on('analysis:add', copperwad.server.analysis.add);
@cdaringe
cdaringe / leveldown-pouch-error-bindings
Created October 12, 2015 18:09
leveldown-pouch-error-bindings
12 originalLeveldown = require('leveldown');
13 } catch (e) {
>14 debugger; // slapped a debugger in pouchdb to see why leveldown was erroring out
15 }
16 }
debug> repl
Press Ctrl + C to leave debug repl
> e
{ handle: 4,
type: 'error',
@cdaringe
cdaringe / coinstac-vsc.launch.json
Created September 17, 2015 23:12
coinstac-vsc.launch.json
{
"version": "0.1.0",
// List of configurations. Add new configurations or edit existing ones.
// ONLY "node" and "mono" are supported, change "type" to switch.
"configurations": [
{
// Name of configuration; appears in the launch configuration drop down menu.
"name": "Launch app/index.js",
// Type of configuration. Possible values: "node", "mono".
"type": "node",