Skip to content

Instantly share code, notes, and snippets.

View benmccormick's full-sized avatar

Ben McCormick benmccormick

View GitHub Profile
@benmccormick
benmccormick / .vimrc
Created June 3, 2015 04:01
Ben Mccormick's .vimrc June 2015
"Ben McCormick's vimrc
" Plugins
" =============
"Setup Vundle For Package Management
"Vundle begins here, turn off filetype temporarily
filetype off
"Add vundle and any other packages not installed through vundle to our lookup
@benmccormick
benmccormick / marionette2to3.md
Last active November 17, 2018 10:01
Marionette v2 and v3 Concepts

Marionette 3 is currently in development, but one of its main thrusts is going to be simplifying the concepts needed for Marionette Developers. This involves deprecating and renaming some features. This gist is meant to provide a mapping of V2 to V3 concepts to help developers plan for and understand v3.

Disclaimers:

  • this is not an official document
  • I'm not on the Mn core team, this is just the understanding of an observer of the library
  • Mn V3 is still in development. I'll try to keep this document up to date, but if something looks wrong please leave a comment and double check.

Concepts table

@benmccormick
benmccormick / mnobjectradio.shim.js
Created March 8, 2015 17:35
Declarative Radio handling for Marionette.Object
/* This is an experiment to shim support for handling Backbone.Radio
Events, Commands, and Requests onto Mn.Object.
Right now it only supports Object and not other Mn classes due to annoyances
of overriding the constructors of the different classes
It's also written in ES6 and uses my own import names for modules, so
it probably will not work for most people without some alteration as a result
*/
import * as Mn from 'marionette';
import * as Radio from 'radio';
@benmccormick
benmccormick / config.js
Created January 12, 2015 15:09
Configuration file to load a requirejs config both in gulp and the browser
/* jshint ignore:start */
/** This file is a bit of a hack to make the requireJS build paths available
* both in the browser and for gulp. There's some ugliness requires to make
* it loadable/usable in both environments.
**/
var requirePaths = {
paths: {
jquery: 'vendor/jquery/jquery',
jqueryui: 'vendor/jquery/jquery.ui',

There are a few core concepts that are useful to understand when building Marionette applications.

Marionette is designed to help you build build scalable web applications by providing common design patterns as a series of components.Those components are implementations of the concepts described here.

Marionette's concepts build on the concepts introduced by Backbone. If you are new to Backbone, don't worry. This page

@benmccormick
benmccormick / .jshintrc
Created October 13, 2014 02:46
My jsHint Configuration
{
"bitwise":true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 4,
"latedef":true,
"newcap": true,
"nonew":true,
"quotmark":"single",
@benmccormick
benmccormick / contestpicker.py
Created July 27, 2014 17:26
Random Method of selecting 2 contestants from a list
import random
# Implementation of Resevoir Algorithm, see
# http://stackoverflow.com/a/3540315/1424361
def random_line(contestants):
line = next(contestants)
line2 = line
# go through each line, check to see if we
# should select it, with decreasing probability
# over time
@benmccormick
benmccormick / .vimrc
Created July 14, 2014 02:33
vimrc Boilerplate
"<Your Name Here>
" Setup stuff
" ===========
" Use vim rather than vi settings
set nocompatible
" Plugins Setup
@benmccormick
benmccormick / software_inventory2012
Created June 10, 2014 03:32
Software Inventory
## Explanation
This was my end of 2012 software inventory. The goal was to identify all of the things I use software for, evaluate what the best software was to use for those use cases, and then commit to using that software for all of 2013. The goals were simplicity, productivity, and a more focused approach to the tools I use.
## Use Cases & Solutions
#### Web Browsing in Windows
* **Chrome** - I don't love Google's business model. And their designs are hit and miss. But they really do make some great software. In my experience Chrome is the best browser to debug with, the fastest, and handles multiple tabs & searching the best.
@benmccormick
benmccormick / minimal.vim
Last active February 26, 2022 17:09
A minimal vimrc for new vim users
" A minimal vimrc for new vim users to start with.
"
" Referenced here: http://vimuniversity.com/samples/your-first-vimrc-should-be-nearly-empty
"
" Original Author: Bram Moolenaar <Bram@vim.org>
" Made more minimal by: Ben Orenstein
" Modified by : Ben McCormick
" Last change: 2014 June 8
"
" To use it, copy it to