Skip to content

Instantly share code, notes, and snippets.

View rachelmyers's full-sized avatar

Rachel Myers rachelmyers

View GitHub Profile
@rachelmyers
rachelmyers / Dockerfile
Created November 7, 2016 21:34
Rails with a Puma server example
# Our base image is Ruby 2.2, to be run on Amazon Linux.
FROM ruby:2.2
# Install packages
RUN apt-get update && apt-get install -y \
git \
nodejs \
tzdata
# Copy your application into the container.
@rachelmyers
rachelmyers / Dockerfile
Last active October 7, 2016 01:16
An annotated Dockerfile for Rails, running Ruby 2.2.5
# Our base image is Ruby 2.2; it will run on Amazon Linux.
FROM ruby:2.2
# This isn't required, but give yourself some credit
MAINTAINER Your Name Here <Your Email Here>
# Install packages
RUN apt-get update && apt-get install -y \
git \
nodejs \
@rachelmyers
rachelmyers / Dockerfile
Created September 23, 2016 23:26
Annotated Dockerfile for a Flask / Python application
# Set a base Docker image to inherit from
FROM ubuntu:14.04
# This isn't required, but give yourself some credit
MAINTAINER Your Name Here <Your Email Here>
# If you get a library from Homebrew (or `apt-get`) to run it locally, add it to
# this list and Docker will install it with `apt-get`.
RUN DEBIAN_FRONTEND=noninteractive apt-get update --fix-missing && apt-get install -y \
bcrypt \
@rachelmyers
rachelmyers / Dockerfile
Last active September 20, 2016 00:30
A basic Dockerfile for a Rails app moving off Heroku, without addons
# Our base image is Ruby 2.2; it will run on Amazon Linux.
FROM ruby:2.2
# Install packages
RUN apt-get update && apt-get install -y \
git \
nodejs \
tzdata
# Copy your application into the container.
@rachelmyers
rachelmyers / Dockerfile
Created September 15, 2016 00:22
A Dockerfile for a Rails app
FROM ruby:2.3
# Set the base directory used in any further RUN, COPY, and ENTRYPOINT
# commands.
RUN mkdir -p /app
WORKDIR /app
# Copy dependencies into the container
COPY Gemfile Gemfile.lock ./
RUN gem install bundler && bundle install --jobs 20 --retry 5 --without development test
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# general path munging
export PATH=${PATH}:~/bin
export PATH=${PATH}:/usr/local/bin
#export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
@rachelmyers
rachelmyers / Chromebook_setup.md
Last active October 19, 2024 04:52
How I set up my Chromebooks' dev environment

Chromebook Setup Options

Option 1: Stay in Chrome OS

If you're writing bare-bones javascript for the browser, creating Chrome Apps and Extensions, or using remote coding apps like cloud9, Koding, or Nitrous, you may not need to install Ubuntu. Some tutorials can be done entirely within the browser. The tradeoff is that you won't have a full-featured command line, and you may hit a point where you can't install something that you need.

To start coding within Chrome OS, install Text or Caret as a text editor. (Text stores files in Google Docs and Caret stores the files locally on your machine, which may help you choose.) After that, you're good to go, since Chromebooks come with a browser installed.

Optio

@rachelmyers
rachelmyers / issue_template.md
Last active August 29, 2015 14:01
Workshop Issue Template

This workshop's going to be amazing!! Here's what we need to do!

A few months out:

  • Find a venue and sponsor for the workshop. This workshop covers HTML, CSS, and an intro to JavaScript. Sponsoring the workshop costs between $400 and $900, depending on the size of the workshop.
  • Find two co-organizers. It's a lot of work, but always a lot of fun. No experience is necessary; checkout the workshop cookbook if it's new to you. (Also, we match up first time organizers with mentors.)
  • Read through the Fundraising and Accounting Docs

Leave a comment below if you're able to host, sponsor or organize! 😸

Once we have a a venue, sponsors, and organizers, we can:

@rachelmyers
rachelmyers / feature_tracking.js
Created May 30, 2013 17:31
Front End Performance Monitoring
TrackTiming = function(category, feature) {
this.category = category;
this.feature = feature;
this.startTime = new Date().getTime();
this.endTime = null;
return this;
};
TrackTiming.prototype.startTime = new Date().getTime(); // shared startTime
@rachelmyers
rachelmyers / gist:2340042
Created April 8, 2012 21:54
Make Change
def greedy_make_change(num)
denominations = [50, 25, 10, 1]
change = []
while num > 0
denominations.each do |denomination|
if num - denomination >= 0
num -= denomination
change << denomination
break
end