Skip to content

Instantly share code, notes, and snippets.

View jordanhudgens's full-sized avatar

Jordan Hudgens jordanhudgens

View GitHub Profile
<% if flash[:notice] %>
<div class = "alert alert-success">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<%= flash[:notice] %>
</div>
<% elsif flash[:error] %>
<div class = "alert alert-danger">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<%= flash[:error] %>
</div>
require 'rubygems'
require 'dish'
hash = {
movie: "Star Wars",
actors: [
{ age: 22, name: "Luke" },
{ age: 35, name: "Han" },
{ age: 400, name: "Yoda" }
],
class Baseball
end
p Baseball.new.swing
class Baseball
end
class Baseball
def swing
require 'rubygems'
require 'httparty'
# Base Example
class EdutechionalResty
include HTTParty
base_uri 'edutechional-resty.herokuapp.com'
def posts
self.class.get("/posts.json")
def bubble_sort(array)
n = array.length
loop do
swapped = false
(n-1).times do |i|
if array[i] > array[i+1]
array[i], array[i+1] = array[i+1], array[i]
swapped = true
end
<%= div_for(@post, class: "post-index-page") do %>
  <p><strong><%= @post.title %></strong> <%= @post.summary %></p>
<% end %>
<%= div_for(@post, class: "post-index-page") do %>
  <p><strong><%= @post.title %></strong> <%= @post.summary %></p>
&lt;% end %&gt;
Kaminari.configure do |config|
config.page_method_name = :per_page_kaminari
end
if defined?(WillPaginate)
module WillPaginate
module ActiveRecord
module RelationMethods
alias_method :per, :per_page
alias_method :num_pages, :total_pages
end
end
end
end
require 'pp'
my_var = "Hey There"
my_arr = [1, 2, 3, 4, 5, 6, 7]
my_json = "{
id: 1,
title: 'Test Blog Post',
description: 'Here is the content',
puts "What is your name?"
name = gets.chomp
if name == "dog"
p true
else
p false
end