Skip to content

Instantly share code, notes, and snippets.

View pmichaeljones's full-sized avatar
💭
Becoming a better developer, commit by commit.

Patrick Jones pmichaeljones

💭
Becoming a better developer, commit by commit.
View GitHub Profile
.row
- @pets.each_with_index do |pet, index|
- index = index += 1
- if index % 7 == 0
.small-12.medium-4.large-3.columns
.panel.card-style.centered
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Pet Page -->
<ins class="adsbygoogle"
style="display:inline-block;width:250px;height:250px"
<a href='http://boostfitnessmarketing.com/fitnesstexter'>
<img src='http://boostfitnessmarketing.com/wp-content/uploads/FitnessTexter-Website-Icon.png'>
</a>
@pmichaeljones
pmichaeljones / gist:fe8bd2b264614d7fa35a
Created January 7, 2015 18:44
CrossFit Name Generator Controller
class CrossfitNameGeneratorController < ApplicationController
def new
@counter = Counter.where(name:"CrossFit").first
end
def create
@counter = Counter.where(name:"CrossFit").first
respond_to do |format|
@pmichaeljones
pmichaeljones / gist:f2d03213bf7db6511ea0
Created January 7, 2015 18:20
Passing Validation Errors
class Video < ActiveRecord::Base
belongs_to :category , foreign_key: 'category_id'
validates :title, presence: true
validates :description, presence: true
end
--------- Different Code Below. Same Gist Though ----------
@pmichaeljones
pmichaeljones / gist:949e7ac9af7ff62ff265
Last active August 29, 2015 14:13
Sending Mandrill Merge Variables from a Rails Controller
class ContactMailer < ActionMailer::Base
def contact_form_email(obj)
mail :subject => "Contact Form Submission",
:to => "pmichaeljones@gmail.com",
:from => "#{obj[:user][:address]}"
#THIS IS THE IMPORTANT CHANGE
merge_vars =
@pmichaeljones
pmichaeljones / gist:5e17b76ac2df44b25891
Created August 28, 2014 16:59
Ruby on Rails Bootstrap Form
<div class="col-md-2">
<div class="panel panel-primary">
<div class="panel panel-heading">
<h3 class="panel-title">CrossFit Name Generator!</h3>
</div>
<div class="panel-body">
<%= form_tag(crossfit_name_generator_index_path, remote: true) do %>
<div class='form-group'>
<div class='input-group'>
<div class='input-group-addon'><span class='glyphicon glyphicon-arrow-right'></span></div>
@pmichaeljones
pmichaeljones / gist:efbb923e46254ae297f4
Created August 28, 2014 16:58
Ruby on Rails HAML Form
.col-md-4
.panel.panel-primary
.panel.panel-heading
%h3.panel-title CrossFit Name Generator
.panel-body
%p Please use singular adjectives such as: funny, crazy, powerful, etc.
= form_tag crossfit_name_generator_index_path, action: "create", remote: "true" do
.form-group
.input-group
.input-group-addon
@pmichaeljones
pmichaeljones / gist:774797b0aef96506d0a8
Created May 19, 2014 16:13
CrossFit Name Generator
<form id="cf-form" />
<input type="text" id="cf-name" name="cf-name"/>
<input type="submit" id="cf-button" value="Submit!" />
</form>
<p id="result"></p>
<script>
$(document).ready(function(){
submit_form();
module Hand
attr_accessor :score, :hand
@hand = []
@score = 0
def add_card(card)
@hand << card
end