Skip to content

Instantly share code, notes, and snippets.

View krambuhl's full-sized avatar
❤️
I love you!

Eevee Kreevee krambuhl

❤️
I love you!
  • Boogie Woogie Industrial Complex
  • Portland, Oregon
  • 22:22 (UTC -07:00)
View GitHub Profile
{"lastUpload":"2020-05-14T17:43:42.428Z","extensionVersion":"v3.4.3"}
import React, { useEffect } from "react"
import debounce from "lodash.debounce"
const EqualHeight = ({ nodes, children }) => {
const handleResize = debounce(() => {
const currentNodes = nodes.map(node => node.current).filter(a => a)
const dimensionsList = currentNodes.map(node => {
// remove any forced sizing information
node.style.height = 'auto'
node.style.maxHeight = ''
import React from 'react'
import classnames from 'classnames'
import styles from './styles.css'
export default function Wrapper ({
tagName: Tag = 'div',
variant = Wrapper.shell,
className,
children,
...attrs
// variable : type annotation
// name : ArgumentType -> ArgumentType -> ReturnType
// fnAdd : (Num, Num) -> Num
function addFn(a, b) { return a + b; }
// ex.
addFn(1, 2) === 3
@krambuhl
krambuhl / appleseed-component.js
Created September 28, 2016 00:07
Appleseed component template
import createComponent from 'appleseed';
const ui = ({ el }) => ({
el: el
});
const init = ({ ui }) => ({
});
@krambuhl
krambuhl / elm-arch.js
Created July 30, 2016 00:52
elm'ish architecture in javascript
function Table(el) {
this.cacheElements(el);
this.defineUpdates();
// MODEL
this.state = {};
// define initial view state
this.setState({
activeRow: 0
@krambuhl
krambuhl / templates.js
Created July 14, 2016 06:40
Atomic components using ES6 template literals
const stringify = children =>
Array.isArray(children) ? children.join('') : children;
// atoms
const Card = (attrs, children) =>
`<div class="card">
${ stringify(children) }
</div>`;
const Header = (attrs, children) =>
@krambuhl
krambuhl / build-styles.js
Last active April 26, 2016 18:31
POC. Gulp tasks as modules.
const path = require('path');
const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const sass = require('gulp-sass');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer-core');
module.exports = function(opts) {
return function() {
class Car {
options() {
return { truckmode: false, big: false };
}
static config(ops) {
return class extends this {
options() {
return Object.assign({}, super.options(), ops);
}
@krambuhl
krambuhl / hidpi.scss
Created November 9, 2015 01:59
sass mixin for hidpi responsive behavior
@mixin hidpi {
@media only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) { @content; }
}