Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Building High-Performing Software Engineering Teams

Tomasz Bak tb

🚀
Building High-Performing Software Engineering Teams
View GitHub Profile
View banner-component.spec.ts
// ...
describe('BannerComponent (inline template)', () => {
let comp: BannerComponent;
let fixture: ComponentFixture<BannerComponent>;
setupTestBed({
declarations: [ BannerComponent ], // declare the test component
});
beforeEach(() => {
View index.d.ts
declare namespace NodeJS {
export interface Global {
setupTestBed: any;
}
}
declare var setupTestBed: any;
@tb
tb / test.js
Created Oct 11, 2017 — forked from jbaxleyiii/test.js
react-apollo testing
View test.js
import { Component } from "react";
import { print } from "graphql-tag/printer";
import { graphql } from "react-apollo";
import { MockedProvider } from "react-apollo/test-utils";
import { addTypenameToDocument } from "apollo-client/queries/queryTransform";
import { mount } from "enzyme";
import { withSavedPayments, SAVED_ACCTS_QUERY } from "../";
@tb
tb / formikApollo.js
Created Aug 1, 2017 — forked from mwickett/formikApollo.js
Formik + Apollo
View formikApollo.js
import React from 'react'
import { withRouter, Link } from 'react-router-dom'
import { graphql, compose } from 'react-apollo'
import { Formik } from 'formik'
import Yup from 'yup'
import FormWideError from '../elements/form/FormWideError'
import TextInput from '../elements/form/TextInput'
import Button from '../elements/form/Button'
import { H2 } from '../elements/text/Headings'
View adams-heroku-values.md

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@tb
tb / SCSS.md
Created Nov 11, 2016 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do
View SCSS.md

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@tb
tb / _form_validation.scss
Created Aug 24, 2016 — forked from isidroamv/_form_validation.scss
SASS input validation for materializecss & Angular2
View _form_validation.scss
// Text inputs
input:not([type]),
input[type=text],
input[type=password],
input[type=email],
input[type=url],
input[type=time],
input[type=date],
input[type=datetime-local],
input[type=tel],
@tb
tb / MultiSelect.jsx
Created Jul 4, 2016 — forked from kkoch986/MultiSelect.jsx
A MultiSelect prototype for Material UI (v.0.14.4)
View MultiSelect.jsx
/**
* Material UI multi select
*
* Use with:
* <MultiSelect fullWidth={true} value={this.state.values} onChange={(e,v) => this.setState({values: v})}>
* <ListItem primaryText={"Option 1"} value={1} />
* <ListItem primaryText={"Option 2"} value={2} />
* <ListItem primaryText={"Option 3"} value={3} />
* <ListItem primaryText={"Option 4"} value={4} />
* </MultiSelect>
@tb
tb / basic-form-mux.ts
Last active May 15, 2016
AngularAttack hackaton hack of the day: "mux" - component that builds components see https://formsy.2016.angularattack.io/#/basic
View basic-form-mux.ts
import {Component, Input, ViewChild, ViewContainerRef, ComponentResolver, OnInit} from '@angular/core';
import {FORM_DIRECTIVES, FormBuilder} from '@angular/common';
import {FORMSY_BS_DIRECTIVES} from 'ng2-formsy';
import {BasicForm} from './basic.form';
@Component({
selector: 'basic-form-mux',
template: '<template #muxContent></template>',
})
export class BasicFormMux implements OnInit {
@tb
tb / ALTERNATIVES.adoc
Created Jan 15, 2016 — forked from mbbx6spp/ALTERNATIVES.adoc
Super quick list of alternatives to Jira and/or Confluence, Stash, Crucible, etc.
View ALTERNATIVES.adoc