Skip to content

Instantly share code, notes, and snippets.


Tommy Groshong tgroshon

View GitHub Profile
tgroshon / Components.jsx
Last active Jul 16, 2020
Interesting Framework Idea
View Components.jsx
import ReactDOM from "react-dom";
import React from "react";
React Components
export class ReactClassComponent extends React.Component {
View Symmetric Encryption in the Old

Symmetric Encryption in the Old West



You will need 3 teams with 1 or more people on each team (minimum 3 total people).

  • Bankers A: Dodge City
  • Bankers B: Tombstone
tgroshon /
Last active Dec 9, 2019
OOP Code Smells by Martin Fowler and Kent Beck grouped by Mika Mantyla

OOP Code smells

Things that might indicate a problem. RailsConf talk "Get a Whiff of This" by Sandi Metz

  • Couplers: binds objects together
    • feature envy (send more messages to object than to self)
    • inappropriate intimacy (access private methods/data)
    • message chains (law of demeter; too many dots)
    • middle man (sole purpose to forward on calls)
tgroshon /
Last active Oct 24, 2019
Draft of "React Patterns in a Post-Hooks World"
title author
React Patterns in a Post-Hooks World
name url
Tommy Groshong


React is an amazing library and over the last 5 years has transformed the

View reducer_vs_state_example.js
import axios from "axios";
// Using `useState()` to manage individual pieces
function ComponentWithPlainState({ coursenum }) {
let [loading, setLoading] = useState(false);
let [data, setData] = useState();
let [errors, setErrors] = useState();
useEffect(() => {
tgroshon / artemis.js
Last active Aug 29, 2019
Idea for more managed data lib
View artemis.js
import React from 'react';
import axios from 'axios';
import { createStore } from 'redux';
// GOAL:
// let { useCustomers, ArtemisProvider } = makeDataLayer(schema, axios)
// let { customers, signup } = useCustomers('fetch');
const schema = {
Customers: {
tgroshon /
Last active May 22, 2019
For all those stupid fibonnaci questions
def fib_n_recur(n):
''' Recursive fibonnaci
Pro: Matches mathematical definition
Con: O(2^n) runtime; n > 40 crazy slow; will blow the stack on large n
if n == 0:
return 0
elif n == 1:
tgroshon /
Created May 1, 2019
Capture of Amplify build system "amplifyPush" helper script
#!/usr/bin/env bash
set -e
help_output () {
echo "usage: amplify-push <--environment|-e <name>> <--simple|-s>"
echo " --environment The name of the Amplify environment to use"
echo " --simple Optional simple flag auto-includes stack info from env cache"
exit 1
tgroshon / example-schema.graphql
Last active Apr 4, 2019
Example GraphQL Schema
View example-schema.graphql
# These are your main API Types
type User {
id: ID!
name: String!
email: AWSEmail
type Activity {
id: ID!
from operator import itemgetter, eq
from functools import partial
Find dictionary with ID = 2 in a functional way
records = [{'id': 1}, {'id': 2}, {'id': 3}, {'id': 4}]
def compose(*funcs):
def h(*args, **kwargs):
You can’t perform that action at this time.