Skip to content

Instantly share code, notes, and snippets.

View rachelmyers's full-sized avatar

Rachel Myers rachelmyers

View GitHub Profile
@rachelmyers
rachelmyers / strstr
Created December 6, 2010 07:18
white. boards. suck.
def substring(haystack, needle)
i = 0
while i <= haystack.length
if haystack[i,(needle.length)] == needle
return i
else
i += 1
end
if i == haystack.length
return nil
@rachelmyers
rachelmyers / string js koans
Created January 4, 2011 07:51
Beginnings of an introduction to test-first javascript development inspired by Jim Weirich's Ruby Koans.
// 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.
describe("Strings", function() {
describe("Creating Strings", function() {
var double_quote_string;
var single_quote_string;
var talking_string;
var apostrophe_string;
@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 / math.html
Created January 12, 2011 22:20
Answer for javascript homework class
<!--
Write a program that accepts three numbers from the user
and alerts back the the user: the sum of the numbers,
the total of the numbers multiplied together, the average
of the numbers, and, for extra credit, figure out how to
find the largest number and smallest number.
-->
<!DOCTYPE HTML>
<HTML>
@rachelmyers
rachelmyers / jqueryhw.html
Created January 19, 2011 23:10
Week 2 HW Answer for BC's LP:JS class
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>JQuery Homework</TITLE>
<SCRIPT type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></SCRIPT>
<SCRIPT type="text/javascript">
var x = parseFloat(prompt("Please give me a number."))
var y = parseFloat(prompt("Please give me a number."))
var z = parseFloat(prompt("Please give me a number."))
@rachelmyers
rachelmyers / bubblegum.html
Created February 3, 2011 03:23
Week 4 homework example for JS class
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>Bubble Gum Game</TITLE>
<SCRIPT type="text/javascript">
//<![CDATA
function bubble()
{
var answer = Math.floor(Math.random()*21);
var guess = parseInt(prompt("How many blows before this bubble bursts?"));
@rachelmyers
rachelmyers / strip
Created February 14, 2011 07:19
My first state machine! Hooray!
STATE_CHOPPING_FRONT = 0
#STATE_ITERATING_END = 1
STATE_CHOPPING_END = 2
STATE_FINISHED = 3
def strip(array)
state = STATE_CHOPPING_FRONT
loop do
if state == STATE_CHOPPING_FRONT then
if array[0].white_space?
@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
@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 / 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: