Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am christianmccormick on github.
  • I am christianm (https://keybase.io/christianm) on keybase.
  • I have a public key ASBX4HC30LFDlri9XFGgBlcGgsgNqM_1-Pg3yeiUJOldDAo

To claim this, I am signing this object:

@christianmccormick
christianmccormick / Work.jsx
Last active January 28, 2019 06:05
An excerpt from my portfolio. I use this React component to render case studies from markdown files. When the component mounts it parses frontmatter metadata, parses the body as HTML, loads the included images, and adds their sources into the parsed HTML. Note that this makes use of dynamic imports, image loading via Webpack, and React CSS Modules.
import React from 'react';
import { withRouter } from 'react-router-dom'
import fm from 'front-matter';
import marked from 'marked';
import styles from './Work.css';
import Button from '../button';
class Work extends React.Component {
constructor(props) {
super(props);
@christianmccormick
christianmccormick / untappd_business.rb
Last active January 28, 2019 05:49
A Ruby module built for Rails that interfaces with the Untappd Business API and stores Untappd menu items using the UntappdMenuItem model. The process is wrapped in a transaction that will revert to the last stored set of menu items if there is an error. It is built to be extensible so that other Untappd endpoints can be added in the future.
module UntappdBusiness
class Client
include HTTParty
base_uri 'https://business.untappd.com/api/v1'
end
class Helpers
def self.get_authorization_header
UntappdBusinessLogger.debug("Using Untappd Business user #{Rails.application.secrets.untappd_email}")
"Basic #{Base64.strict_encode64("#{Rails.application.secrets.untappd_email}:#{Rails.application.secrets.untappd_auth_token}")}"