Skip to content

Instantly share code, notes, and snippets.

View DanielMSchmidt's full-sized avatar
🚀
Working on Terraform Core

Daniel Schmidt DanielMSchmidt

🚀
Working on Terraform Core
View GitHub Profile
@DanielMSchmidt
DanielMSchmidt / index.js
Last active May 31, 2017 09:37
Minimal example of how to use zipkin
const express = require('express');
const { BatchRecorder, Tracer, Annotation, ExplicitContext } = require('zipkin');
const { HttpLogger } = require('zipkin-transport-http');
const tracer = new Tracer({
ctxImpl: new ExplicitContext(),
recorder: new BatchRecorder({
logger: new HttpLogger({
endpoint: 'http://localhost:9411/api/v1/spans',
}),
@DanielMSchmidt
DanielMSchmidt / wercker.yml
Created May 9, 2017 22:13
Expo deployment through wercker
box: node
build:
steps:
- script:
name: Install Exponent CLI
code: |
npm install -g exp
# A step that executes `npm install` command
- npm-install
@DanielMSchmidt
DanielMSchmidt / ci-check.sh
Last active May 7, 2017 08:48
Prettier CI Check
./node_modules/.bin/prettier --write ./**/*.js # insert your prettier command here
if [ "$(git status --porcelain | wc -l)" != "0" ]; then exit 1 ; fi
$ npm install -g flow-bro # npm installation
$ yarn global add flow-bro # yarn installation
$ flow-bro get-untyped 2
This may take a while, concurrency is limited to reduce the failure rate.
Why dont you go get a coffee, I will do the heavy lifting!
The following files have the least flow coverage:
{
"jest": {
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
"\\.(css|less|scss|sass)$": "identity-obj-proxy"
}
},
}
@DanielMSchmidt
DanielMSchmidt / accordion-test.js.snap
Created August 21, 2016 13:24
The snapshot for the accordion
exports[`Accordion renders the additional content on hover 1`] = `
<ul>
<li>
<h3>
Foo
</h3>
</li>
<li>
<h3>
Bar
@DanielMSchmidt
DanielMSchmidt / accordion-test.js
Last active September 3, 2021 08:17
A Jest snapshot test for an accordion
import React from 'react';
import renderer from 'react-test-renderer';
import Accordion from '../src/components/Accordion';
describe('Accordion', () => {
it('renders the additional content on hover', () => {
const component = renderer.create(
<Accordion activeIndex={1} headlines={['Foo', 'Bar', 'Baz']} content={['Foo Content', 'Bar content', 'Baz content']} />
);
@DanielMSchmidt
DanielMSchmidt / index.android.js
Created April 14, 2016 08:35
react native init bar with react-native: 0.23.1
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
@DanielMSchmidt
DanielMSchmidt / LoginForm.js
Created April 14, 2016 08:13
redux-form + autofill
@reduxForm({
form: 'login',
fields: ['email', 'password'],
validate: validation // email and password are both required
})
class LoginForm extends Component {
static propTypes = {
fields: PropTypes.object.isRequired,
handleSubmit: PropTypes.func.isRequired,
}
@DanielMSchmidt
DanielMSchmidt / LoginForm.js
Last active May 12, 2016 14:42
redux-form + autofill
@reduxForm({
form: 'login',
fields: ['email', 'password'],
validate: validation // email and password are both required
})
class LoginForm extends Component {
static propTypes = {
fields: PropTypes.object.isRequired,
handleSubmit: PropTypes.func.isRequired,
}