Skip to content

Instantly share code, notes, and snippets.

View mxriverlynn's full-sized avatar
🏳️‍🌈
coding while trans

River Lynn Bailey mxriverlynn

🏳️‍🌈
coding while trans
View GitHub Profile
@mxriverlynn
mxriverlynn / react-1.js
Last active August 29, 2015 14:28 — forked from ericelliott/hello-word.js
react component
'use strict';
let Hello = function (props) {
return {
props, // set props
render () {
@mxriverlynn
mxriverlynn / angular-1.js
Last active August 29, 2015 14:28
component based ui
angular.module('docsTemplateUrlDirective', [])
.controller('Controller', ['$scope', function($scope) {
$scope.customer = {
name: 'Naomi',
address: '1600 Amphitheatre'
};
}])
.directive('myCustomer', function() {
return {
templateUrl: 'my-customer.html'
@mxriverlynn
mxriverlynn / 1.js
Last active August 30, 2015 04:10
broker channel vs broker instance
var filtersChannel = Postal.channel("filters");
function FilterController(options){
this.region = options.region;
filtersChannel.subscribe("add", (filter) => this.showFilter(filter));
}
FilterController.prototype.showFilter = function(filter){
var view = new FilterView(filter);
@mxriverlynn
mxriverlynn / .vimrc
Created August 19, 2015 13:36
my .vimrc file
set nocompatible
silent! call pathogen#runtime_append_all_bundles()
colorscheme twilight
set guifont=Monaco:h20
set nowrap
set showcmd
set showmode
set number
@mxriverlynn
mxriverlynn / fluentconf.md
Last active August 29, 2015 14:27
fluentconf 2016 proposal ideas

idea: a talk about javascript architecture based on the way people think

will cover abstractions, naming things, building large systems from small peices, communication patterns between all the small parts, etc.

will talk about naming things for what they represent - a "schema" (psychology term, not database / xml document term) on which we build understanding

vertical slices of code, broken down in to small peices

component based development as small parts of UI - examples in backbone and maybe other frameworks

@mxriverlynn
mxriverlynn / 1.js
Last active October 17, 2016 19:58
managing modal dialogs with promises
orgChart = {
addNewEmployee: function(){
var employeeDetail = this.getEmployeeDetail();
employeeDetail.on("cancel", () => {
// the modal was cancelled...
// go back to previous UI / step / whatever
});
var FoodOrder = {
// public API
// ----------
process: function(customer, burger, fries, drink) {
Register.acceptPayment(customer, () => {
this.makeOrder(customer, burger, fries, drink);
});
},
@mxriverlynn
mxriverlynn / nodevember.md
Last active October 14, 2015 19:24
nodevember 2015 talk proposal

Title

A Telegraph To The Future Of The Web

Abstract

In the real world, messages are everywhere. They coordinate activities. They make things happen. They send back results. We are surrounded by messages, day in and day out, as we interact with other people - and as we build applications for the web!

From HTTP and AJAX with JSON documents, to Web Workers and iFrames, to scaling the back-end of Node.js, the web is steeped in messaging patterns. Use them. Take advantage of them. Improve your app design, simplify your code and reduce response time!

@mxriverlynn
mxriverlynn / 1.js
Last active August 29, 2015 14:25
backbone/marionette subtle benefit with ES6 arrow functions
var TitleView = Marionette.ItemView.extend(){
showTitle: function(region){
var title = new Title();
title.on("entry:add", function(){
this.addEntry();
}, this);
region.show(title);
},
@mxriverlynn
mxriverlynn / 0.js
Last active September 10, 2018 08:33
recursing a tree structure with ES6 generators
function *doStuff(){
yield 1;
yield 2;
yield *doStuff();
}
var it = doStuff();
var res;
res = it.next();