Skip to content

Instantly share code, notes, and snippets.


Kris Meister krismeister

View GitHub Profile
View RequireJs pattern
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery', 'mb/core', 'responsive/lib/jquery.cookie'], factory);
} else {
// Browser globals (root is window)
factory(root.jQuery, root.mb);
View gist:6501967
// Assign the module to a Browser global. Ex: root.logger = factory(root.mb)
root.mb = root.mb || {};
root.mb.metrics = root.mb.metrics || {}; = || {};
root.mb.metrics.floodlight = root.mb.metrics.floodlight || {};
var metricsCore = factory(
// List ALL dependencies that this module has. Access the dependencies through the Browser globals (root is window)
View gist:8388685
bash < <(curl -s\&digest=9c84e8370316f24b7189bb9abb02b6af )
* Spree Stack Installer *
This installer should only be run on dedicated Spree servers.
It may affect other applications or configuration files that
are already in use on this machine.
krismeister / PreCodeLanguageMarkdown.rb
Last active Aug 29, 2016
Extend the Redcarpet HTML Renderer to output language-XXX class
View PreCodeLanguageMarkdown.rb
class PreCodeLanguageMarkdown < Redcarpet::Render::HTML
def block_code(code, language)
"<code class='language-#{language}'>#{html_escape(code)}</code>",
krismeister / Effect.ts
Created Mar 18, 2018
NGRX Effects are complicated
View Effect.ts
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import {Store} from '@ngrx/store';
import {Actions, Effect} from '@ngrx/effects';
import * as advancedSearchActions from './actions';
import {createLogger, LOG_LEVELS} from '../../../shared/logger';
import {TenantSearchService} from "../../api/tenantSearch/tenantSearch.service";
import {SearchQueryParams} from "../../ng-models/search/SearchQueryParams.interface";