Skip to content

Instantly share code, notes, and snippets.

View e-schultz's full-sized avatar

Evan Schultz e-schultz

View GitHub Profile
@e-schultz
e-schultz / linkdump.md
Created October 1, 2014 22:01
Various links / resources I've found useful
var koastServer = require('koast');
var config = require('config');
var koast = koastServer(); // by defualt, loads config, but could pass in manually formed {} config object
koast.whenReady().then(function() // some way of letting us know config is done
{
})
@e-schultz
e-schultz / gist:5c3ed30a3d305f6fd327
Created January 29, 2015 12:47
Routers and lists and things
  • In the Content setup for 'Dashboard', pretty much moved the actions / list / etc to live under the 'tab'
 dashboard: {
          id: 'dashboard',
          title: 'Dashboard',

          tabs: [{
            label: 'Analytics',
            tab: 'analytics',

The setup:

  • Basic angular application
  • Has an iframe that is dynamically added to the page, and a dynamic src
  • Page when it loads, goes to a SSO provider
  • Upon logging in - gets redirected to a new page
  • New page sends a postMessage to the parent frame
  • Parent frame then updates the location.path, then does a window.location.reload

The problem:

@e-schultz
e-schultz / misc.md
Last active September 3, 2015 12:17
ES6 Fiddles

Cheap currying,

let logger = store => next => action => {
// middleware
}

// becomes

var logger = function logger(store) {
import { is } from 'immutable'
let x = 0;
let tasksTest$ = this.stateService.select(state=> state.tasks, is).subscribe(n=> {
console.log('this is called... yeah',++x)
})
@e-schultz
e-schultz / state-service.ts
Created March 17, 2016 18:05
state-service
import {Injectable, Inject} from 'angular2/core';
import {BehaviorSubject} from 'rxjs/Rx';
@Injectable()
export default class StateService {
store: any;
_ngRedux: any;
constructor(@Inject('ngRedux') ngRedux) {
this.store = this.observableFromStore(ngRedux);
this._ngRedux = ngRedux;
@e-schultz
e-schultz / app.ts
Created April 6, 2016 12:37
NG2 Modal
import {Component} from 'angular2/core';
import Modal from './modal';
@Component({
selector: 'ngc-app',
template: `
<div class="p3">
<p class="p4">
<button class="btn btn-primary block col-6 mx-auto"
(click)="showModal()">
@e-schultz
e-schultz / ng2conf2016notes.md
Last active May 4, 2016 17:25
ng2conf2016notes

Welcome Talk

  • Focus on speed - rendering, 2.5x faster, re-render, 4.2x faster

  • template compiler - can have an offline compile step, generate optimized javascript

  • Angular 2 - currently, kind of big - 170k, angular1 - was 56k, ng2 - down to 45k

  • improved lazy loading of routes

  • angular universal - server side rendering improvement, sends on the server side - sends out just HTML/css

  • first payload comes down - start streaming full JS to actually run the app

  • can include a preboot script that records user actions - that replays once everything is ready