Skip to content

Instantly share code, notes, and snippets.

🎸
Learning guitar

Jon Rimmer jonrimmer

🎸
Learning guitar
Block or report user

Report or block jonrimmer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View switch-cases.directive.ts
import { Directive, Input, Host, TemplateRef, ViewContainerRef, OnInit, DoCheck } from '@angular/core';
import { NgSwitch } from '@angular/common';
@Directive({
selector: '[jrSwitchCases]'
})
export class SwitchCasesDirective implements OnInit, DoCheck {
private ngSwitch: any;
private _created = false;
@jonrimmer
jonrimmer / component.spec.ts
Created May 3, 2018
Clearing all pending tasks from the fake async zone
View component.spec.ts
import { fakeAsync, tick } from '@angular/core/testing';
import { discardFakeAsyncTimers ) from './helpers';
const myComponent = {};
describe('My Component', () => {
before(fakeAsync(() => {
myComponent.getAsyncData();
// Run async stuff.
@jonrimmer
jonrimmer / index.ts
Last active Feb 13, 2018
Storybook Angular tagged template function sketch
View index.ts
function ngTemplate(strings: TemplateStringsArray, ...propExpressions: any[]) {
return strings.reduce((acc, strValue, index) => {
acc.template += strValue;
if (index < propExpressions.length) {
const propKey = '__storybook_prop_' + index;
acc.template += propKey;
acc.props[propKey] = propExpressions[index];
}
return acc;
@jonrimmer
jonrimmer / debug.md
Created Dec 1, 2015
atom-beautify issue
View debug.md

Atom Beautify - Debugging information

The following debugging information was generated by Atom Beautify on Tue Dec 01 2015 15:48:35 GMT+0000 (GMT).


Platform: darwin

Versions

@jonrimmer
jonrimmer / ui-grid-resize.js
Created Feb 26, 2015
Auto-Resize Directive for Angular UI-Grid
View ui-grid-resize.js
(function() {
angular
.module('myApp')
.directive('myUiGridResize', myUiGridResizeDirective);
/* @ngInject */
function myUiGridResizeDirective(gridUtil, uiGridConstants) {
return {
restrict: 'A',
require: 'uiGrid',
@jonrimmer
jonrimmer / gist:5881843
Created Jun 28, 2013
CSS state machine syntax concept
View gist:5881843
@states mainLayout {
@state initial {
::host {
background-color: black;
}
.main-content {
height: 95%;
}
@jonrimmer
jonrimmer / nested-list.html
Created Oct 16, 2011
Creating Tree-Tables in HTML and CSS
View nested-list.html
<ul>
<li>Jon
<ul>
<li>Bob</li>
<li>Jim</li>
<li>Dave</li>
</ul>
</li>
<li>Rob</li>
<li>Matt
You can’t perform that action at this time.