Skip to content

Instantly share code, notes, and snippets.

View agoldis's full-sized avatar
🎯
Focused

Andrew Goldis agoldis

🎯
Focused
View GitHub Profile
@agoldis
agoldis / .babelrc
Created April 7, 2018 19:54
Minimal setup for project with react, webpack, babel 7, eslint, prettier
{
"presets": [
"@babel/preset-react",
["@babel/preset-env", {
"targets": {
"browsers": ["last 2 versions", "safari >= 7"]
}
}]
]
}
@agoldis
agoldis / TasksByUser-01.jsx
Last active April 10, 2018 05:31
redux blog
/*
index.js
*/
import React from "react";
import { render } from "react-dom";
import { Provider } from "react-redux";
import { createStore } from "redux";
import Header from "./Header";
import UserTasks from "./UserTasks";
@agoldis
agoldis / normalized.js
Last active April 3, 2018 06:08
redux blog
{
app: {
users: {
user01: {
id: "user01",
name: "John"
},
user02: {
id: "user02",
name: "Bob"
@agoldis
agoldis / naive_example.java
Created March 29, 2018 06:31
Comments frustrated - naive example
List<ResultType> resultsList = new ArrayList<>();
final Double TWO = new Double(2);
final Double LIMIT = new Double(10);
for(ItemType item: itemsList) {
if(Math.pow(item.x, TWO) + Math.pow(item.y, TWO) < Math.pow(LIMIT, TWO)) {
resultsList.add(item.toResultType());
}
}
@agoldis
agoldis / rename_with_decouple.java
Last active April 4, 2018 17:30
Comment frustration - rename and decouple
public Boolean isWithinCircle(Double x, Double y, Double radius) {
final Double TWO = new Double(2);
return (Math.pow(x, TWO) + Math.pow(y, TWO)) < Math.pow(radius, TWO);
}
public List<PhotosCollection> getPhotosCollectionsWithinRadius(List<Locations> locationsList) {
List<PhotosCollection> photosCollection = new ArrayList<>();
final Double RADIUS = new Double(10);
for(Location location: locationsList) {
@agoldis
agoldis / renaming.java
Last active March 30, 2018 04:15
comment frustration - renaming
public List<PhotosCollection> getPhotosCollectionsWithinRadius(List<Locations> locationsList) {
List<PhotosCollection> photosCollection = new ArrayList<>();
final Double TWO = new Double(2);
final Double RADIUS = new Double(10);
for(Location location: locationsList) {
if((Math.pow(x, TWO) + Math.pow(y, TWO)) < Math.pow(RADIUS, TWO)) {
photosCollection.add(location.getPhotosCollection());
}
@agoldis
agoldis / comment.java
Last active April 4, 2021 06:38
Comments frustration - comment example
List<ResultType> resultsList = new ArrayList<>();
final Double TWO = new Double(2);
final Double LIMIT = new Double(10);
for(ItemType item: itemsList) {
// add items' photos located within circle with radius LIMIT
// to a collection of photos
if(Math.pow(item.x, TWO) + Math.pow(item.y, TWO) < Math.pow(LIMIT, TWO)) {
resultsList.add(item.toResultType());
}
}
@agoldis
agoldis / .eslintrc.js
Created March 8, 2018 19:37
eslint + prettier config
module.exports = {
"extends": [
"standard",
"plugin:react/recommended",
"prettier",
"prettier/react",
"prettier/standard"
],
"plugins": [
"react",
@agoldis
agoldis / roxlogger.js
Created August 6, 2017 13:01
Basic logger for node
const LOGLEVELS = {
mute: -1,
error: 0,
warn: 1,
info: 2,
debug: 3
}
let currentLevel = LOGLEVELS.mute
@agoldis
agoldis / example
Created July 5, 2017 12:52
google support exampl
Delivered-To: [email protected]
Received: by 10.12.157.78 with SMTP id n14csp706940qvf;
Wed, 5 Jul 2017 05:20:59 -0700 (PDT)
X-Received: by 10.107.27.210 with SMTP id b201mr14798702iob.76.1499257259393;
Wed, 05 Jul 2017 05:20:59 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1499257259; cv=none;
d=google.com; s=arc-20160816;
b=O/TbkclP2a8BxzCXrJudncahAmEFhMjnEUYOoYX0rXIKPuyip8kdP5qdgyimwuyCb+
IslnQuAy1xdQ1VwOZXOrqIoztwkwDMMoZzK4uH/e8IQKLBssnKX5itu3oBOaV+XPevpg
BTNrx8XdIt3Z6NLrKCjjaeWXIz4kiaaSlBOqGgUcRfe90WZvFLvJmXnfsxOp4QSWLD9f