Skip to content

Instantly share code, notes, and snippets.

🍞
Probably baking something.

Beau Smith beausmith

🍞
Probably baking something.
Block or report user

Report or block beausmith

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
@beausmith
beausmith / inputHandler.jsx
Created May 2, 2018
One React method to control all html form elements
View inputHandler.jsx
updateInputValue = ({ currentTarget: { name, value, checked, type } }) => {
this.setState({
[name]: type === 'checkbox' ? checked : value || this.initialState[name]
})
}
@beausmith
beausmith / SVG.js
Created May 23, 2017
React Native SVG Component using react-native-svg
View SVG.js
// React Native SVG Component
// https://github.com/react-native-community/react-native-svg
//
// Process
// 1. Clean up SVG in graphics app (Illustrator/Sketch/etc) to set consistent width, height, and make sure the viewBox is "0, 0, W, H"
// 2. Open SVG in text editor to remove width, height, and any undesired/unnecessary styles
// 3. Open in https://jakearchibald.github.io/svgomg/ and optimize.
// 4. Integrate info app by converting SVG tags to component-based SVG tags used in https://github.com/react-native-community/react-native-svg and updating with JS variables such that I can controls dimensions, colors, etc.
// 5. Use in other components.
//
@beausmith
beausmith / SVG.js
Created May 23, 2017
React Native SVG Component
View SVG.js
// React Native SVG Component
// https://github.com/react-native-community/react-native-svg
//
// Process
// 1. Clean up SVG in graphics app (Illustrator/Sketch/etc) to set consistent width, height, and make sure the viewBox is "0, 0, W, H"
// 2. Open SVG in text editor to remove width, height, and any undesired/unnecessary styles
// 3. Open in https://jakearchibald.github.io/svgomg/ and optimize.
// 4. Integrate info app by converting SVG tags to component-based SVG tags used in https://github.com/react-native-community/react-native-svg and updating with JS variables such that I can controls dimensions, colors, etc.
// 5. Use in other components.
//
View Examples.md

Dissatisfied with work from InfiniteRed

We hired InfiniteRed, instead of a less expensive contract-developer option, because we were promised a senior-level engineer and React Native expert.

Rather than learning and making progress with solid code from the InfiniteRed expert, we found ourselves continually surprised by the lack of code quality. Once we realized the code from our assigned expert was not of expert or senior level, we decided to wind down the contract.

Since parting with InfiniteRed, we regularly find bugs and surprising bits of code to clean up originating from our assigned expert.

Below are some of bugs and poor quality code which was committed to our repo by our assigned InfiniteRed expert. There are more examples, but this should be sufficient to prove that we were not assigned an expert or senior-level engineer.

@beausmith
beausmith / ship
Created Dec 29, 2016
ship - alias for pushing git branches to a remote
View ship
#!/bin/bash
set -e
CURRENT=$(git symbolic-ref -q HEAD || git rev-parse HEAD)
CURRENT=${CURRENT#refs/heads/}
gitdir=$(git rev-parse --git-dir)
# default settings
verbose=true
@beausmith
beausmith / gpr
Last active Dec 29, 2016
Pull Request from
View gpr
#!/usr/bin/env bash
set -e
urlencode() {
read
local length="${#REPLY}"
for (( i = 0; i < length; i++ )); do
local c="${REPLY:i:1}"
case $c in
View gist:fa33a50a257472f21d9b
### Keybase proof
I hereby claim:
* I am beausmith on github.
* I am beausmith (https://keybase.io/beausmith) on keybase.
* I have a public key whose fingerprint is 70C7 A12F 31C3 A983 EE98 7C5D 9355 8244 0AD3 A25F
To claim this, I am signing this object:
@beausmith
beausmith / Slim for loop
Created Oct 23, 2013
Iterating through an array using a for loop in slim lang template
View Slim for loop
- for i in (1..5)
div #{i}
- for i in [0,4,8,12,16,20,24] do
div #{i} #{i + -12}
- if (i == 0)
div 0
- elsif (i < 12)
div lt 12
- else
View webkit-pseudo-elements.md

Some updates to Angelina Fabbro's tremendous original reference document. The most notable additions are shadow pseudoclasses for scroller pseudoelements.

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want: -webkit-appearance:none;

<video>

video::-webkit-media-controls-panel

@beausmith
beausmith / isotope-centered-masonry-and-masonry-gutters.js
Last active Nov 6, 2019 — forked from mattstauffer/gist:3835881
Isotope with Centered Masonry and Masonry Gutters.
View isotope-centered-masonry-and-masonry-gutters.js
$(function() {
// Tweaked from: https://gist.github.com/mattstauffer/3835881
// No guarantees
// 1. include Isotope.js
// 2. include this file
// 3. customize Isotope options at the bottom of this file
// 4. add "margin: 0 auto" to the isotope container
$.Isotope.prototype._getMasonryGutterColumns = function() {
You can’t perform that action at this time.