Skip to content

Instantly share code, notes, and snippets.

// ...
const MeetingTypesDashboardView = Backbone.View.extend({
render() {
ReactDOM.render(
<MeetingTypesDashboard />,
this.el
);
return this;
// ...
// An example of one of our "custom virtual DOM" functions
/**
* Updates a template folder's name among the user's list of template folders.
*
* @param {TemplateFolderModel} templateFolderModel
*/
_updateTemplateFolderName(templateFolderModel) {
const id = templateFolderModel.get('_id');
import PropTypes from 'prop-types';
/**
* This is an example presentational component. Check out this article for details on why we use
* presentational components:
* https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0.
*
* The names of presentational components should be suffixed with '-Template'. This is done so that
* our React naming conventions align with our Backbone naming conventions.
import React from 'react';
import PropTypes from 'prop-types';
import CBR from 'connect-backbone-to-react';
/**
* Don't use `BackboneProvider` from `connect-backbone-to-react`; only use `connectBackboneToReact`.
*
* `BackboneProvider` allows you to make Backbone Models and Collections available "globally" for a
* set of components and is bad for a couple of reasons:
* - Components that expect to receive Backbone Models or Collections from their parent component
@spencer-brown
spencer-brown / yarnification.js
Created April 26, 2017 19:45
A script for "yarnifying" projects - updating them to use Yarn instead of npm.
const chalk = require('chalk');
const fs = require('fs');
const del = require('del');
const spawnSync = require('child_process').spawnSync;
/**
* A script for "yarnifying" projects - updating them to use Yarn instead of npm.
*
* Usage:
#!/bin/bash
# Creates new applications within Open Shift Origin using the `oc` command line tool.
#
# The specified GitHub URL is used to fetch application code. Applications are created with the specified
# subdomain as <subdomain>.usb.cs.purdue.edu. The passed user ID is associated with the created application
# as a label so that stats fetched for applications can be scoped by user by passing the `-l` flag.
#
# Usage:
# ./make-new-app <GitHub URL> <desired subdomain (eg. 'foobar')> <Pley dashboard user ID>