Skip to content

Instantly share code, notes, and snippets.

View robwelan's full-sized avatar

Rob Welan robwelan

View GitHub Profile
.pin-label {
font-size: 0.7rem;
margin: 0;
position: relative;
top: -9px;
left: 2px;
}
import PropTypes from 'prop-types';
import React from 'react';
import Load from 'external-load';
import Loadable from 'react-loadable';
import CircularProgress from '@material-ui/core/CircularProgress';
// Children
import Map from './map';
@robwelan
robwelan / cot-blog-utilities-validation-parallax.js
Last active October 14, 2019 07:48
the utility referenced by cot-blog-react-component-parallax.jsx (gist:robwelan/14354bd8394cea0a9162a401ba3683be#cot-blog-utilities-validation-parallax.js)
const validation = {
default: {
color: 255,
alpha: 0.4,
},
color(color) {
let validColor = this.default.color;
if (!Number.isNaN(color)) {
if (color < 0) {
@robwelan
robwelan / cot-blog-react-component-parallax.jsx
Last active October 14, 2019 07:33
parallax gist (gist:robwelan/e2a4f838c23d01e12067d2bff2abca34#cot-blog-react-component-parallax.jsx)
import React from 'react';
import PropTypes from 'prop-types';
import validation from '../../utilities/validation/parallax';
const Parallax = (props) => {
const {
alpha,
blue,
children,
green,
@robwelan
robwelan / getMyLocation.js
Created October 13, 2019 23:57
How to get location from the navigator (browser window). These are the utility functions for use with reactjs-hoc-browser-location.jsx
const getLocation = () => {
const options = {
enableHighAccuracy: true,
timeout: 5000,
maximumAge: 0,
};
return new Promise((resolve, reject) => {
navigator.geolocation.getCurrentPosition(resolve, reject, options);
});
import React from 'react';
import { getMyLocation } from '../utilities';
const withLocation = (WrappedComponent) => (
class extends React.Component {
constructor(props) {
super(props);
this.state = {
accuracy: null,
@robwelan
robwelan / git-push-existing-folder.bat
Last active September 25, 2019 08:34
git-push-existing-folder
cd existing_folder
git init
git remote add origin git@[YOUR_PROJECT_FOLDER].git
git add .
git commit -m "Initial commit"
git push -u origin master