- account add jabber USERNAME@chat.hipchat.com 'PASSWORD'
- account hipchat set nick_source full_name
- account hipchat set resource bot
- account hipchat on
angular | |
.module('ContentRepeat', []) | |
.directive 'contentrepeat', ($compile) -> | |
priority: 1000 | |
terminal: true | |
compile: (element, attr, linker) -> | |
template = $compile(element.html()) | |
element.empty() | |
(scope, self, attr) -> |
var Dialog = React.createClass({ | |
mixins: [Portal], | |
createPortal: function() { | |
this.dialog = $(this.portalNode).dialog({ | |
autoOpen: false, | |
title: this.props.title, | |
close: this.props.onClose | |
}).data('ui-dialog'); | |
}, |
var EventEmitter = require('events').EventEmitter; | |
var mergeInto = require('react/lib/mergeInto'); | |
module.exports = createStore; | |
function createStore(initialState) { | |
var events = new EventEmitter(); | |
var state = initialState || {}; | |
return { |
While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.
Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.
const immutableJSFormatter = { | |
header(x) { | |
if (x && x.toJS) return ['span', {}, x.toString()]; | |
return null; | |
}, | |
hasBody(x) { | |
return x && x.toJS; | |
}, | |
body(x) { | |
return ['span', {}, JSON.stringify(x.toJS(), null, 2)]; |
TL;DR - smelly software engineer discusses using rethinkdb changefeeds for building caches, breaks hearts, shaves the cheerleader, shaves the world.
Let's talk about caches.
Imagine that you build UIs for an ecommerce company, possibly in a fancy office with free coffee and whatnot. You've just been asked to build a way for the marketing / sales folks to change landing pages whenever they're running campaigns. After a number of angry discussions involving the ux team about what they can and cannot change, you settle on a 'document' format for these pages. It could be json describing a tree of widgets of banners and carousels, or html, or yaml, or whatever. Maybe you also invent a dsl that marks out parts of the document as dynamic, based on request parameters or something. I dunno, I'm not your boss. You build a little ui over the weekend (with react? maybe!) that lets these folks login, drag and drop their banners, maybe upload an image or two, and save to database.
Yo
let (<|) = ('a => 'b, 'a) => 'b; // purescript and haskell use ($) | |
let (|>) = ('a, 'a => 'b) => 'b; // purescript uses (#) | |
let compose: ('b => 'c, 'a => 'b, 'a) => 'c; | |
let (<<) = compose; // purescript uses (<<<), haskell uses (.) | |
let composeFlipped: ('a => 'b, 'b => 'c, 'a) => 'c; | |
let (>>) = composeFlipped; // purescript uses (>>>) |