Skip to content

Instantly share code, notes, and snippets.

View rachelmyers's full-sized avatar

Rachel Myers rachelmyers

View GitHub Profile
@rachelmyers
rachelmyers / Chromebook_setup.md
Last active October 25, 2023 10:00
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 / 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
@rachelmyers
rachelmyers / String JS Koans, more like Ruby Koans
Created January 4, 2011 22:15
Jasmine tests for using javascript strings, meant as a introduction to test-first js development.
// Written by Rachel Myers as a introduction to test-first javascript development.
// Inspired by and very nearly lifted from Jim Weirich's Ruby Koans, which are awesome.
// Replace the nulls to make the specs pass and reach javascript enlightenment.
describe('Strings', function () {
// Creating Strings
it('should create a new string with either single or double quotes', function() {
@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 / 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.
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 / 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