Skip to content

Instantly share code, notes, and snippets.

View iammerrick's full-sized avatar

Merrick Christensen iammerrick

View GitHub Profile
@iammerrick
iammerrick / gist:8778977
Created February 3, 2014 04:47
The old $/_.extend, the old Mootools options, the iconic Object.prototype.extend... Yes merging defaults with configuration using Object.assign.
class Person {
constructor(config = {}) {
var defaults = {
name: 'Unknown',
age: 23
};
[defaults, config].reduce(Object.assign, this);
}
}
@iammerrick
iammerrick / Useage.md
Created March 16, 2014 18:41
rjs-build-analysis example

The easiet implementation of the tool is to leverage rjs build time hooks, in our case we are leveraging done as added in the grunt-contrib-requirejs plugin. r.js build analysis leverages the format of manifest of build.txt that r.js provides in the case of the plugin we use the contents of that file provided directly via stdio. You could read the build.txt and invoke the analysis on that as well.

{
done: function(done, response) {
       var status = true;
       var duplicates = analyzer.duplicates(response, {
         exclude: ['publications/public/app.js']
       });
@iammerrick
iammerrick / .vimrc
Created March 20, 2014 23:12
My Rig
" Vundle
filetype off
" Plugins
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" Vundle installed

A domain specific programming language + package manager for querying genomes.

$ genome install is_male
$ genome install alzheimers
require 'is_male'
require 'alzheimers'

XCode 6 Simulator + Charles Proxy

Run this command to get Charles Proxy support for your XCode 6 Simulators

/** @jsx React.DOM **/
var React = require('react');
module.exports = React.createClass({
propTypes: {
navigationStore: React.PropTypes.shape({
fetch: React.PropTypes.func,
all: React.PropTypes.func
})
React.createClass({
render() {
var stylesheet = Stylesheet.create({
div: {
color: '#FF0000',
display: 'flex'
}
});
return <div style={stylesheet.div}>Hello World!</div>
var styles = new Stylesheet({
'loading': {
position: 'absolute',
top: 0,
right: 0,
bottom: 0,
left: 0,
display: '-webkit-flex'
},
var routes = Routes(null,
Route({ name:'Home', path:'/', handler:AppHandler },
Route({ name:'Stack', path:'/stack/:id', handler:StackHandler, stackService:new StackService(), cardService:new CardService()}),
Route({ name:'Card', path:'/card/:id', handler:CardHandler, cardService:new CardService()}),
DefaultRoute({handler:NavigationHandler, navigationService:new NavigationService()})
)
);