Skip to content

Instantly share code, notes, and snippets.

Micah Godbolt micahgodbolt

Block or report user

Report or block micahgodbolt

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 test.ts
interface IMenu {
stuff?: any;
items: string[];
}
interface IButton {
...
menuProps?: IMenu
}
View example.tsx
class Content extends React.Component {
constructor() {
super();
}
render() {
return (
<Fabric className='foo'>
<DefaultButton
onClick= {() => alert('hello')}
View FabricTodo.js
import React, { Component } from 'react';
import './App.css';
import { TextField, PrimaryButton, Checkbox, ProgressIndicator} from "office-ui-fabric-react";
class App extends Component {
constructor(props) {
super(props);
this.state = {
todo: null
View wsl_install_node.md

The apt-get version of node is incredibly old, and installing a new copy is a bit of a runaround.

So here's how you can use NVM to quickly get a fresh copy of Node on your new Bash on Windows install

$ touch ~/.bashrc
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
// restart bash
$ nvm install node
View propsExample.md

Nested Yaml

props:
  BUTTON:
    BACKGROUND:
      value: blue
    COLOR:
      value: white 
    HOVER:
      BACKGROUND:
View example.md

Theo lets you preprocess your JSON data before sending it through to its normal processes. This preprocess allows you to use a nested props structure, which is then converted to standard flat props.

props:
  BUTTON:
    BACKGROUND:
      value: blue
    COLOR:
      value: white 
    HOVER:
@micahgodbolt
micahgodbolt / hero.twig
Last active Nov 11, 2016 — forked from kevinmpowell/hero.twig
Nunjucks component macro - NOTE: Had to use .twig file extension since Github Gists don't support .njk :(
View hero.twig
<div class="hero" style="background-image:url({{ background_image OR "http://placehold.it/1000x400" }})">
<h1 class="hero__title">{{ title OR "We Are Awesome" }}</h1>
{% block body %}
{% endblock %}
{% block footer %}
<a class="hero__cta button button--primary" href="{{ cta_href OR "/some/awesome-link.html" }}>{{ cta_text OR "Find Out Why!" }}</a>
{% endblock %}
</div>
View button.scss
.ms-Button.ms-Button--primary {
background-color: $ms-colorBackgroundButtonPrimary;
color: $ms-colorTextButtonPrimary;
&:hover {
background-color: $ms-colorBackgroundButtonPrimaryHover;
}
}
View automated_test.js
describe("Promo Band pattern", function() {
before(function() {
browser.url("/tests/promo_band");
return browser;
});
it("should look like baseline", function() {
return browser
.compareScreen("promo_band", {
name: "pattern",
View presenter.twig
{% embed 'band.twig' with
{
"global": _context,
"body": {
"layout": "gallery5"
},
"meta": meta,
} only
%}
You can’t perform that action at this time.