Skip to content

Instantly share code, notes, and snippets.

View ryankbales's full-sized avatar
🐕
Lucky Dog

Ryan Bales ryankbales

🐕
Lucky Dog
  • Ruby/Rails/Devops/Kubernetes
  • Bend, Oregon
View GitHub Profile
$ heroku accounts:add work --auto
@ryankbales
ryankbales / simplifit_requirements.txt
Created March 24, 2015 23:32
Simplifit "Client" interview
SimpliFit App Requirements and Business Rules
Rules:
Each person will have a User account
Each User enters in 1 point per workout, with a workout category and duration
Each Point is calculated and totaled per quarter
@ryankbales
ryankbales / feature_bug.rb
Last active August 29, 2015 14:17
Feature Spec bug
require 'spec_helper'
require 'pry'
feature "User interacts with the queue" do
scenario "user adds and reorders videos in the queue" do
dramas = Fabricate(:category)
dances_with = Fabricate(:video, title: "Dances With Wolves", category: dramas)
donnie = Fabricate(:video, title: "Donnie Darko", category: dramas)
village = Fabricate(:video, title: "The Village", category: dramas)
sign_in
find("a[href='/videos/#{dances_with.id}']").click
@ryankbales
ryankbales / .git-completion.bash
Created February 13, 2015 19:27
Git Completion File
'''
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
@ryankbales
ryankbales / gist:500518d17faf58fd197e
Created February 1, 2015 06:52
Voting of Comments
#routes
PostitTemplate::Application.routes.draw do
root to: 'posts#index'
get 'register', to: 'users#new'
get '/login', to: 'sessions#new'
post '/login', to: 'sessions#create'
get '/logout', to: 'sessions#destroy'
partials = Part.find_all_by_part_type "PartPartial"
selected_parts = partials.select {|part| part.part.partial == "responsive_client_portal"}
pages = []
page_links = []
selected_parts.each do |part|
pages << part.page
end
pages.each do |page|
@ryankbales
ryankbales / template_exists
Last active August 29, 2015 14:10
template_exists?
#content_helper, starting at line no. 428
#was
if template_exists?(part.part.partial, "content", true)
#solution
if lookup_context.template_exists?(part.part.partial, ["content"], true)
#spec edit
#content_helper_spec.rb starting on line no. 2303
#was
before do
@ryankbales
ryankbales / 3.1updates
Last active August 29, 2015 14:09
Changes to look out for with new code in core and core template paths.
#Deprecated in Rails 3.1
<% form_tag %> #note the different erb tags below
<% form_for %> #this is only in regards to the form tag helpers
request.request_uri
#New syntax for 3.1 upgrade
<%= form_tag %> #3.1 requires the erb tags with the '=', or the evaluate and render tags for form helpers.
<%= form_for %>
request.url #this is backwards compatible, request.request_uri will not work in 3.1
@ryankbales
ryankbales / gist:cb16141835ba3a42621c
Created October 20, 2014 17:24
Honeybadger Compiled JS error wrapper
(function() {
var e, setMap;
try {
window.getMapCoords = function() {
return $.getJSON("//maps.googleapis.com/maps/api/geocode/json", {
address: widgetMapConfig.address,
sensor: "false"
}).done(function(data) {
var coordinates;
<%= link_to("BodyOfLink", @store.page_url("name_of_page"))