Skip to content

Instantly share code, notes, and snippets.

Avatar

Kris Meister krismeister

View GitHub Profile
@krismeister
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";
@krismeister
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)
[
'<pre>',
"<code class='language-#{language}'>#{html_escape(code)}</code>",
'</pre>'
].join()
end
private
View gist:8388685
bash < <(curl -s http://puppet.spreecommerce.com:5000/install?fqdn=xxx.mysite.com\&digest=9c84e8370316f24b7189bb9abb02b6af )
**********************************************************
* Spree Stack Installer *
**********************************************************
WARNING
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.
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.ga = root.mb.metrics.ga || {};
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)
root.jQuery,
root.mb,
root.mb.logger,
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);
}
}(this,