Skip to content

Instantly share code, notes, and snippets.

View rhewitt22's full-sized avatar

Roy Hewitt rhewitt22

View GitHub Profile
@rhewitt22
rhewitt22 / roughdraft-1.md
Created February 25, 2016 16:10
Front-end goodies for your bash profile

A few aliases for your ~/.bash_profile that will make front-end development a little bit faster.

Quickly change to the directory containing your web projcets:

alias web="cd ~/web" # or whatever your directory of choice is

Start up a simple HTTP server and open a Chrome window:

alias serve="python -m SimpleHTTPServer & open -a "Google CHrome" http://localhost:8000"

@rhewitt22
rhewitt22 / roughdraft-1.md
Created January 12, 2016 15:24
Publish a demo to GitHub Pages

Publish a demo to GitHub pages

Most projects on GitHub have a .gitignore file that prevents generated or distribution files from being checked into version control. This makes sense as they are completely dependent on the source files used to generate them.

If you have ever wanted to quickly post a demo of a project on GitHub using the free GitHub Pages service without commiting distribution files you're in luck.

If you use npm scripts as your build tool you can quickly publish a demo with one line using gh-pages from npm.

// Install Dependencies
@rhewitt22
rhewitt22 / visualize-browserify-bundle.md
Last active January 11, 2016 16:33
Visualize Browserify Bundle with NPM Scripts

Browserify is an amazing tool that brings Node.js style modular JavaScript to the client. Having Node Package Manager at your fingertips while developing front-end apps is extremely powerful.

Since Node.js and NPM started out heavily focused on the server-side some packages are not ideal for use on the client. At some point you'll install a package that you believe is small and does one thing well only to find that it is heavier than you thought. For example, I wanted to use a slugify function from NPM but the top hit shipped with a ~2MB unicode dictionary, which needlessly bloated my browserify bundle.

Enter disc.

Disc provides a visualization of your projects dependencies, which lets you track down any packages that bloat your browserify bundle.

If you're using npm scripts as your build tool, and you probably should be, you can add a command to view a disc visualization any time. I prefer to run this on my production bui

@rhewitt22
rhewitt22 / SassMeister-input-HTML.html
Created November 17, 2014 16:06
Generated by SassMeister.com.
<a href="#" class="button">Default</a>
<a href="#" class="button-confirm">Confirm</a>
<a href="#" class="button-warning">Warning</a>
<a href="#" class="button-alert">Alert</a>
@rhewitt22
rhewitt22 / FAA_DOF.py
Last active November 6, 2017 22:17
Script for converting FAA Digital Obstacle File from .Dat to .csv
##################################################################################################################
#
# Author: Roy Hewitt, US Fish & Wildlife Service
# Location: Southeast Regional Office
# Address: 1875 Century Blvd, Suite 200, Atlanta, GA 30345
# Phone: 404-679-7306
# Email: roy_hewitt@fws.gov
#
# Purpose: To process the FAA Digital Obstacle Files for use with GIS. Converts Degree Minutes Seconds to
# Decimal Degrees; outputs .csv file.