Skip to content

Instantly share code, notes, and snippets.

:octocat:
Over-engineering ALL my side-projects

Matthew Oden Potter matthewoden

:octocat:
Over-engineering ALL my side-projects
Block or report user

Report or block matthewoden

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@matthewoden
matthewoden / AWS Git Setup.md
Created May 22, 2016
Setting up a remote Git in AWS EC2
View AWS Git Setup.md

AWS Remote Git Setup

Get a local git repo up on an EC2 Instance.

Add youself to SSH Authentication:

Add yourself to the ssh auth agent, if you haven't already.

ssh-add path/to/your/EC2.pem

Set up destination directory:

@matthewoden
matthewoden / Elixir Config.md
Created Feb 21, 2017
Handling Environment variables in elixir
View Elixir Config.md

####david.antaramian in @elixir-lang slack, #beginners [2:11 PM]

Just in case you need it for reference in the future, this is the problem we normally see people run into: People will sometimes have called the environment variable during a module attribute assignment. Like the following:

defmodule MyAPP.APIClient do
  @api_key System.get_env("API_KEY")
end
@matthewoden
matthewoden / ElixirErlang.md
Last active Sep 3, 2017
Instructions for setting up elixir and erlang without brew, and without compiling from source
View ElixirErlang.md

Setting up Erlang and Elixir from precompiled binaries.

Itching to write Elixir? Are you not allowed, don't want to use homebrew? Too lazy to compile from source? Here's step-by step instructions to get Elixir and Erlang up and running on your mac, using precompiled binaries.

Setting up Erlang

  1. Download a precompiled version of Erlang from here.
  2. Run that thing.
  3. When complete, type erl in your terminal to test that erlang has been appropriately added to your path.

Setting up Elixir

  1. Download the precompiled zip from latest, unzip, rename the folder to elixir.
@matthewoden
matthewoden / useClassnames.js
Created Jun 25, 2015
Dynamic classnames for react and react native.
View useClassnames.js
/*
This is a real simple pattern that allows you to
maintain a syntax similar to classnames, but use
CSS Module mode in webpack.
(solving the problem of cleanly using object properies as keys)
*/
function use(result, conditions){
/*
@matthewoden
matthewoden / https-instance-single.config
Created May 5, 2017
.ebextenstions configuration files for a single instance docker deploy environment (cert files, auto upgrade from http to https, etc)
View https-instance-single.config
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443
FromPort: 443
CidrIp: 0.0.0.0/0
View GenServerLogs.md

Gunshots or Fireworks

I'm working on a little app that crowdsources the answer to "was that gunshots? or were those fireworks?", roughly 2-5 minutes after the sound was heard.

It's hard to tell in the city sometimes.

Anyway, it does this by checking the public call logs for all St. Louis Metro Police department "calls for service" (so 911 calls, non-emergency calls, etc). The call logs can be found here: http://www.slmpd.org/cfs.aspx

It runs this check every two minutes, and parses the result. After a little data padding (geocoding results and intersections, ISO formatting timestamps, etc), it adds it to a MapSet, so there's exactly one record per result.

@matthewoden
matthewoden / Fullpage.js
Created Jun 24, 2015
How to set up server side rendering with react proxy loader, and avoid a checksum mismatch.
View Fullpage.js
/*
So the above file here is my Full page react file. I do a couple things here:
- In the head, I inject my important CSS inline.
- In the body, I link to my commons chunk (with react, react-router, and anything that's going to be on every single page).
- Beneath that is the app entry file.
- Beneath that is a dynamically generated chunkfile, based on the current route.
Each of these are cachebusted with a hash, pulled from the webpack stats file.
*/
View gist:b1d66b3d1600d251ccbb614191ba9f1c
### Keybase proof
I hereby claim:
* I am matthewoden on github.
* I am matthewoden (https://keybase.io/matthewoden) on keybase.
* I have a public key whose fingerprint is F6F6 2057 3940 2832 DE5A 2CEA 8C29 6376 B13A 3DD4
To claim this, I am signing this object:
@matthewoden
matthewoden / README.md
Last active Jan 21, 2016
Your CSS doesn't have to be a mess.
View README.md

CSS in 2016

So this is roughly how I handle CSS these days. As much as I'd like to use CSSModules for everything, I work on a lot of different projects, for a lot of different clients. They can't all be a SPA.

Some of this seems blindingly obvious. But until I stop cleaning up messy, repetitive CSS, I figure it all merits being said.

Create a Baseline

I use one file to style HTML. This creates a baseline for the body, defines my box model, sets global typography rules, etc. If I need to style an HTML element, I style it globally. Otherwise, I give an element a class, and only style that class.

You can’t perform that action at this time.