Skip to content

Instantly share code, notes, and snippets.

Avatar

Rachel Myers rachelmyers

View GitHub Profile
@rachelmyers
rachelmyers / Dockerfile
Created Nov 7, 2016
Rails with a Puma server example
View Dockerfile
# 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 Oct 7, 2016
An annotated Dockerfile for Rails, running Ruby 2.2.5
View Dockerfile
# 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 Sep 23, 2016
Annotated Dockerfile for a Flask / Python application
View Dockerfile
# 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 Sep 20, 2016
A basic Dockerfile for a Rails app moving off Heroku, without addons
View Dockerfile
# 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 Sep 15, 2016
A Dockerfile for a Rails app
View Dockerfile
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
View gist:fb33be824a340deea113
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 Jun 28, 2022
How I set up my Chromebooks' dev environment
View Chromebook_setup.md

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 Aug 29, 2015
Workshop Issue Template
View issue_template.md

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
Front End Performance Monitoring
View feature_tracking.js
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
View gist:2340042
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