Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Let's fix some stuff

Todd Baur toadkicker

🏠
Let's fix some stuff
View GitHub Profile
@toadkicker
toadkicker / code_organization_react.md
Last active Nov 20, 2020
Atomic design in code layout
View code_organization_react.md

How I organized react apps

This is a design I came up with to incorporate atomic design into the code layout in a project. This has given me the leverage to extract out good parts to cross platform tools and reusable API's for the team. Welcome feedback/additions!

src/
  libs/ **filters, config tools, etc
  modules/
View gist:2f13ef289b8b0931e002a9141de14c71
import { Button } from '@material-ui/core';
import CloseIcon from '@material-ui/icons/Close';
import SaveIcon from '@material-ui/icons/Save';
import UndoIcon from '@material-ui/icons/Undo';
import { Formik } from 'formik';
import { i18n } from 'i18n';
import model from 'modules/contact/contactModel';
import React, { Component } from 'react';
import FormSchema from 'view/shared/form/formSchema';
import Spinner from 'view/shared/Spinner';
@toadkicker
toadkicker / rename.sh
Created Feb 5, 2020
Rename all file extensions in a directory recursively
View rename.sh
/* Rename current directory's *.js files to *.tsx */
find . -name "*.js" -exec bash -c 'mv "$1" "${1%.js}".tsx' - '{}' \;
@toadkicker
toadkicker / twittermute.txt
Created Jan 24, 2020 — forked from IanColdwater/twittermute.txt
Here are some terms to mute on Twitter to clean your timeline up a bit.
View twittermute.txt
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@toadkicker
toadkicker / _typography.scss
Created Dec 3, 2019
Scaling fonts with px/rem
View _typography.scss
html,
body {
font-size: 14px !important;
}
h1 {
font-size: 1.602em;
}
h2 {
View Vue SVG Icons
<template>
<component class="svg-inline--icon" :is="dynamicIcon" />
</template>
<script>
export default {
name: 'Icon',
props: {
icon: {
type: String,
@toadkicker
toadkicker / index.js
Last active Apr 15, 2019
Convert Rails i18n YAML fies to JSON using Node. Built for vue-i18n to read json files from `config/locales/` in a Nuxt.js project.
View index.js
module.exports = {
locales: [
{
code: 'en',
iso: 'en-US',
name: 'English',
file: 'en.json'
}
]
}
@toadkicker
toadkicker / about.html.erb
Last active Jan 13, 2019
How to build the simplest static site with Rails (yes I know you can put files in public and call that simpler. This uses the framework)
View about.html.erb
<p>Hi! I'm an about page. Edit me in views/static_pages/</p>
@toadkicker
toadkicker / circle.yml
Last active Aug 29, 2018
CircleCI 2.0 configuration for Ruby on Rails 5.1+ with headless chromedriver
View circle.yml
# Ruby CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/ruby:2.5.1-node-browsers
View Sort a csv with headers
(head -n 2 <file> && tail -n +3 <file> | sort) > newfile
You can’t perform that action at this time.