Skip to content

Instantly share code, notes, and snippets.

View hoitomt's full-sized avatar
🏠
Working from home

Michael Hoitomt hoitomt

🏠
Working from home
View GitHub Profile
@hoitomt
hoitomt / signup-form.js
Created April 26, 2012 21:09
tutorial - inline validation
$(function() {
hideAllHelpers();
$('#person_first_name').focus(function() {
$('#person_first_name_helper').show(200);
});
$('#person_first_name').blur(function() {
$('#person_first_name_helper').hide(200);
});
@hoitomt
hoitomt / gist:5798628
Last active December 18, 2015 14:39
Cucumber Tests for Meeting
Feature: Ratings and Reviews
As a User,
In order to rate a listing
I should be able to leave a review for a listing
Scenario: Successfully submit the review
Given a Ratings and Review form for a Listing
When the form is submitted with valid information
Then the browser should be redirected to the R&R Thank You page
And the ratings count should be incremented by 1 for the listing
@hoitomt
hoitomt / gist:5798684
Last active December 18, 2015 14:39 — forked from colinrymer/gist:5798469

Product management has come up with the idea of allowing website users to leave reviews and ratings for listings. This feedback will be entered similar to how leads are submitted, but the user must enter the following information:

  • name
  • email address
  • phone number
  • rating from 1 to 5
  • optional review

In addition to the above information, a CAPTCHA presenting three different apartment complexes (only one of which is correct) is used in conjunction with the user’s name and phone number to determine whether or not the user actually lived at the listing. After validating and verifying the information, the user gets redirected to a thank you page. After a review is successfully submitted, it will show up as the first entry in the reviews for the listing. Pre-existing “certified resident” reviews will be integrated along with reviews that are submitted through the site. On the search results page, users can sort on rating type or filter on review type and rating. A link on each listing will take the us

@hoitomt
hoitomt / overview.md
Last active December 30, 2015 09:29
A ruby script runner combined with a phantomjs script that will pull attributes from a specified network request and compare the attributes. Specifically used for auto-tagging

Overview - Autotag Comparer

Status

Work In Progress

Usage

Put the ruby file (url_runner.rb) and the phantom file (resource_sniffer.js) into the same directory. Run the ruby file for fun and profit:

ruby url_runner.rb
var hash = window.location.hash;
var token = '0007zWwBHQBqmKj6KIDMo5HENldn9hwYpfq8EPhqkn';
var redirectUrl = 'https://reviews.local.apartmentguide.com/#' + token;
var url = 'https://primediaTest.okta.com/login/sessionCookieRedirect?token=' + token + '&redirectUrl=' + redirectUrl;
if(!hash.length) {
window.location.replace(url);
}
@hoitomt
hoitomt / log_request.go
Created January 30, 2015 12:56
Golang: Log HTTP Requests in Go
package main
import (
"fmt"
"log"
"net/http"
"os"
)
func main() {
@hoitomt
hoitomt / mysite.nginx.conf
Last active August 29, 2015 14:15
Nginx Configuration for Web Sockets
# Allows websocket connections on /websocket
upstream mysite {
server 127.0.0.1:3000;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
@hoitomt
hoitomt / habtm.md
Last active August 29, 2015 14:23
Create a has and belongs to many relationship in Rails 4.2

This will create a parents table, a kids table and a relationship between the two tables.

  1. Create the Parents table

    bundle exec rails generate model parents fname:string lname:string
    
  2. Create the Kids table

    bundle exec rails generate model kids fname:string lname:string
    
@hoitomt
hoitomt / Stack
Last active September 2, 2015 18:10
Stack - [a, b, c, d]
Start:
node4 -> node3 -> node2 -> node1
Stack - no idea how many items are in it, only knows the top item
@data = node4
Next - Add a new node to the stack - "push"
push(value)
@hoitomt
hoitomt / footspeed.md
Created August 4, 2016 17:55
Foot Quickness Drills

https://www.youtube.com/watch?v=bUBtG39Q7dw

  1. Fast Feet
  2. Wideouts
  3. Lateral line hops
  4. Vertical line hops
  5. 1 leg lateral line hops
  6. 1 leg vertical line hops
  7. Lateral shuffles - back and forth across a center section (he uses a weight)
  8. 4 cone agility drill