Skip to content

Instantly share code, notes, and snippets.

View tb's full-sized avatar
🚀
Building High-Performing Software Engineering Teams

Tomasz Bak tb

🚀
Building High-Performing Software Engineering Teams
View GitHub Profile
@tb
tb / formikApollo.js
Created August 1, 2017 14:43 — forked from mwickett/formikApollo.js
Formik + Apollo
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'

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 / test.js
Created October 11, 2017 21:53 — forked from jbaxleyiii/test.js
react-apollo testing
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 / SCSS.md
Created November 11, 2016 08:51 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ 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 August 24, 2016 12:55 — forked from isidroamv/_form_validation.scss
SASS input validation for materializecss & Angular2
// 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 July 4, 2016 14:52 — forked from kkoch986/MultiSelect.jsx
A MultiSelect prototype for Material UI (v.0.14.4)
/**
* 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 / ALTERNATIVES.adoc
Created January 15, 2016 09:48 — forked from mbbx6spp/ALTERNATIVES.adoc
Super quick list of alternatives to Jira and/or Confluence, Stash, Crucible, etc.
# When an RSpec test like this fails,
#
# @my_array.should == [@some_model, @some_model2]
#
# RSpec will call inspect on each of the objects to "help" you figure out
# what went wrong. Well, inspect will usually dump a TON OF SHIT and make trying
# to figure out why `@my_array` is not made up of `@some_model` and `@some_model2`
# really really painful.
#
# This little module and technique helps get around that. It will redefine `inspect`
Install Java JDK 6.0 update 31 on Ubuntu 12.04 LTS
Introduction
The first question is why are we installing an old JDK. The answer is that Oracle JDK 6.0 update 31 is the JDK recommended by Cloudera when installing CDH4 (Cloudera Distribution Hadoop v4).
This is an update to an older version of this post. Mainly I have changed the JDK from 1.6.0_26 to 1.6.0_31 as this is the recommended JDK for CDH4 .
Install Java
I have a 64 bit version of Ubuntu 12.04 LTS installed, so the instructions below only apply to this OS.
namespace :server_db do
task :get, :roles => :app do
puts "This task is designed to get database from the server"
puts "Example: cap ENV server_db:get"
timestamp = Time.new.strftime("%Y-%m-%d-%H%M%S")
tmp_dir = '~/tmp'
db_name = "viclarity_#{rails_env}"
db_dump = "#{db_name}_#{timestamp}"
db_dump_gz = "#{tmp_dir}/#{db_dump}.gz"