Skip to content

Instantly share code, notes, and snippets.

View gruppjo's full-sized avatar
🌈
Sparkling

Jonathan Grupp gruppjo

🌈
Sparkling
View GitHub Profile
@gruppjo
gruppjo / coding_fun.md
Last active November 6, 2017 17:05
office fun
@gruppjo
gruppjo / coding_help.sh
Last active October 19, 2017 12:57
coding_help
// npm-check
// check dependency status of your project
// https://www.npmjs.com/package/npm-check
npx npm-check
// json-server
https://github.com/typicode/json-server
@gruppjo
gruppjo / react-utils.js
Last active September 17, 2019 23:36
React: Component: mapLooksToStyles() - map a components this.props.looks to a joined string of css module styles `styles[look1] styles[look2] ...`
// map a components this.props.looks to a joined string of css module styles `styles[look1] styles[look2] ...`
// or allows to pass in css class names from parent
// <Component looks="isYellow"></Component>
// CSS: .isYellow { }
export function mapLooksToStyles(looks = '', styles = []) {
let customStyles = (looks && looks.trim().split(' '))
|| [];
return customStyles.map(look => styles[look] || look).join(' ');
}
@gruppjo
gruppjo / javascript.json
Last active March 19, 2020 23:17
react-snippets (class components)
{
// Place your snippets for javascriptreact here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@gruppjo
gruppjo / .editorconfig
Last active June 8, 2020 17:16
.editorconfig
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
@gruppjo
gruppjo / _animations.scss
Last active May 2, 2020 14:33
_animations.scss with global animation defaults and @mixin transition($properties...)
/* V1.2 based on Jonathan's Gist */
/* https://gist.github.com/gruppjo/b5c6389b1ef71369e815c95cb1b33813 */
$animationDuration: 300ms;
$animationDurationMs: 300;
$animationDurationShort: 150ms;
$animationDurationShortMs: 150;
$animationDurationLong: 30000ms;
$animationDurationLongMs: 30000;
$animationFunction: ease;
@gruppjo
gruppjo / ProjectCSSTransition.js
Last active May 2, 2020 14:58
ProjectCSSTransition using global hardwired _animations.scss defaults
/* V1.0 based on Jonathan's Gist */
/* https://gist.github.com/gruppjo/3e1c33537c1f3613f04fea87dac16a36 */
import React from 'react';
import styles from 'styles-imports/shared.scss';
import { CSSTransition } from 'react-transition-group';
/**
@gruppjo
gruppjo / javascript.json
Last active December 11, 2020 11:40
react-snippets (function components)
{
// Place your snippets for javascriptreact here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@gruppjo
gruppjo / storybook.scss
Last active April 30, 2020 16:44
global storybook scss file
@import "shared.scss";
// each component in storybook is wrapped inside of .root
#root {
// give 100% so we can have an unbroken chain of height: 100%;
// https://stackoverflow.com/questions/7049875/why-doesnt-height-100-work-to-expand-divs-to-the-screen-height
height: 100%;
}
/* STORY BOOK SPECIFIC GLOBAL STYLES */