Skip to content

Instantly share code, notes, and snippets.

View evanharmon's full-sized avatar

Evan Harmon evanharmon

View GitHub Profile
@evanharmon
evanharmon / Router.js
Created August 12, 2019 20:59 — forked from dabit3/Router.js
Router implementation for React Authentication
import React from 'react'
import {
withRouter,
Switch,
Route,
Redirect,
BrowserRouter as Router
} from 'react-router-dom'
import { Auth } from 'aws-amplify'
@evanharmon
evanharmon / userdata-nvm.sh
Created July 6, 2017 16:20 — forked from matthewflanneryaustralia/userdata-nvm.sh
Install NVM via ec2 userdata
cat > /tmp/subscript.sh << EOF
# START UBUNTU USERSPACE
echo "Setting up NodeJS Environment"
curl https://raw.githubusercontent.com/creationix/nvm/v0.25.0/install.sh | bash
echo 'export NVM_DIR="/home/ubuntu/.nvm"' >> /home/ubuntu/.bashrc
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> /home/ubuntu/.bashrc
# Dot source the files to ensure that variables are available within the current shell
@evanharmon
evanharmon / react-login-form.js
Created May 9, 2017 00:25
Example login form vanilla react
import React, { Component } from 'react';
class LoginForm extends Component {
constructor(props) {
super(props);
this.state = {
email: '',
password: ''
};
}
@evanharmon
evanharmon / .global_ignore
Created July 13, 2016 13:20
My global git ignore
tags
.swp
@evanharmon
evanharmon / .ctags
Last active July 13, 2016 13:48
My ctags config file
--recurse=yes
--exclude=.git
--exclude=**/dist/*
--exclude=**/node_modules/*
--exclude=db/*
--exclude=log/*
--exclude=coverage/*
--langdef=css
--langmap=css:.css
--langmap=css:+.scss
@evanharmon
evanharmon / .bootstraprc
Last active May 29, 2016 19:58
bootstrap 4 webpack config file
# Output debugging info
# loglevel: debug
# Major version of Bootstrap: 3 or 4
bootstrapVersion: 4
# If Bootstrap version 4 is used - turn on/off flexbox model
useFlexbox: true
# Webpack loaders, order matters
@evanharmon
evanharmon / html.snippets
Last active June 27, 2016 12:41
nvim html snippets
###############################################################################
# HTML
###############################################################################
snippet option "option" b
<option value="${1:default}">${2}</option>${0}
endsnippet
###############################################################################
# ANGULAR
###############################################################################
snippet ngmodel "ngModel"
@evanharmon
evanharmon / base-client.c
Created March 29, 2016 01:54
SImple base client in C
#include <stdio.h>
#include <stdlib.h>
#include <netdb.h>
#include <netinet/in.h>
#include <string.h>
#include <unistd.h>
/* adapted from http://www.cs.rpi.edu/~moorthy/Courses/os98/Pgms/socket.html */
int main(int argc, char *argv[]) {
@evanharmon
evanharmon / base-server.c
Last active April 12, 2016 00:57
Simple base server in C
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
/* adapted from http://www.cs.rpi.edu/~moorthy/Courses/os98/Pgms/socket.html */
@evanharmon
evanharmon / .c-ycm_extra_conf.py
Last active April 30, 2016 11:38
nvim ycm youcompleteme c file
# Copyright (C) 2014 Google Inc.
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ycmd is distributed in the hope that it will be useful,