Skip to content

Instantly share code, notes, and snippets.

View GarthDB's full-sized avatar
🕸️
never updating status

Garth Braithwaite GarthDB

🕸️
never updating status
View GitHub Profile
@GarthDB
GarthDB / rework-script.js
Last active September 18, 2019 22:45
Rework Metadata
const path = require('path');
const fs = require('fs');
const yaml = require('js-yaml');
const order = [
'id',
'name',
'dnaStatus',
'status',
'ignoreDNA',
# Run npm install --dev [email protected] to resolve 3 vulnerabilities
SEMVER WARNING: Recommended action is a potentially breaking change
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Regular Expression Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ minimatch │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ mocha [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ mocha > glob > minimatch │
import test from 'ava';
class Basic {
constructor(str) {
this.str = str;
}
}
test('should match object and typed object', t => {
const basic = new Basic('tada');
@GarthDB
GarthDB / button.jsx
Created February 2, 2017 17:11
JS Framework CSS example
import React from 'react';
import Filler from 'filler';
const cssClassName = Filler.className('topcoat-button');
export default class Button extends React.Component {
render() {
return <button className={cssClassName}>Button</button>;
}
}
@GarthDB
GarthDB / regexs.yml
Created October 28, 2016 18:36
Helpful Atom RegExs
all:
- regex: "((?:\w|-)*)":\s?\S*\n?
replace: "$1 "
description: list of npm dependencies from package json into npm install command
@GarthDB
GarthDB / filters.css
Created May 25, 2016 15:46
Styling filters on Redux example todo app
.filters {
background: #2c3e50;
height: 80px;
box-sizing: border-box;
color: #ecf0f1;
box-shadow: 0 0 2px 1px rgba(0,0,0,0.2);
padding: 32px 35px 0;
width: calc(100% + 20px);
font-weight: 700;
border: 0;

.filters

When styling an app it is best if we start with semantic, uncluttered markup.

This isn't just an idealistic approach, it has real tangible benefits:

  • The code is descriptive which makes it easier to maintain
  • It also makes it easier to predict how browser or user stylesheets might interact
  • Often times it makes it easier to style
  • If for some reason the stylesheet fails to load, things still make sense
import { connect } from 'react-redux'
import React from 'react'
const mapStateToProps = (state) => {
return { entries: state.entries }
}
const BGEntry = ({
entries
}) => (
Object {
history:
Object {
listenBefore: [Function: listenBefore],
listen: [Function: listen],
transitionTo: [Function: transitionTo],
pushState: [Function: pushState],
replaceState: [Function: replaceState],
push: [Function: push],
replace: [Function: replace],
@GarthDB
GarthDB / Gemfile
Last active August 29, 2015 14:15
Design Open Gemfile
source 'https://rubygems.org'
gem 'github-pages'
# Test the build
group :test do
gem 'rake'
gem 'html-proofer'
end