Skip to content

Instantly share code, notes, and snippets.

View raderj89's full-sized avatar

Jared Rader raderj89

View GitHub Profile
@raderj89
raderj89 / 0_reuse_code.js
Created April 30, 2014 15:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@raderj89
raderj89 / jquery_example.html
Last active August 29, 2015 13:57 — forked from dbc-challenges/jquery_example.html
Intro to jQuery for Phase 0
<!DOCTYPE html>
<html>
<head>
<title>DOM manipulation with jQuery</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery_example.js"></script>
</head>
<body>
<h1> Hello. Welcome to the jQuery DOM Manipulation Challenge! </h1>
<div class="mascot">
%h2 New Project
= form_for(@project) do |f|
%div{ id: "error_explanation" }
- if @project.errors.any?
%h2= pluralize(@project.errors.count, "error")
Prohibited this project from being saved:
%ul
- @project.errors.full_messages.each do |msg|
%li= msg
%p
@raderj89
raderj89 / boggle_class.rb
Last active August 29, 2015 13:55 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
boggle class challenge
class BoggleBoard
def initialize(dice_grid)
@dice_grid = dice_grid
end
def create_word(*coords)
coords.map { |coord| @dice_grid[coord.first][coord.last] }.join("")
end
def get_row(row)
@raderj89
raderj89 / index.html.erb
Last active August 29, 2015 13:55
various bootstrap divs
<div class="row">
<div class="col-md-6">
<h1>Refcodes</h1>
Referral discounts for great tech<br>
products and services
</div>
<div class="col-sm-6 message">
Share referral discounts for your favorite web products and services, and redeem discounts for other products and services you want to try out. Oh, and if you see that there is already a post for the same referral deal, don't duplicate it. Otherwise, we might remove it.
<br>
<span class="pull-right">Thanks!</span>
class BoggleBoard
#your code here
end
dice_grid = [["b", "r", "a", "e"],
["i", "o", "d", "t"],
["e", "c", "l", "r"],
@raderj89
raderj89 / edit.html.erb
Last active December 31, 2015 12:29
trying to get account upgrades working
<div class="panel panel-default">
<div class="panel-heading">
<div class="panel-title">
<h1>Edit <%= resource_name.to_s.humanize %></h1>
</div>
Current account: <%= resource.plan.name %>
</div>
<div class="panel-body">
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
<%= devise_error_messages! %>
@raderj89
raderj89 / markdown_preview.js
Created December 9, 2013 02:55
markdown preview
(function( $ ){
$.fn.markdownPreview = function() {
return this.each(function() {
var $this = $(this);
$this.wrap( '<div class="markdown_wrap editing"></div>' );
@raderj89
raderj89 / home.html.erb
Last active December 30, 2015 17:48
my horrible awful stripe/signup integration
<div class="jumbotron center">
<h1 class="center-header">Blocipedia</h1>
<h2 class="center-header">Social, Markdown Wikis</h2>
<br>
<div class="row">
<div class="col-sm-5">
<h3>Free Account</h3>
<ul>
<li>Create unlimited public wikis</li>
<li>Collaborate with unlimited users</li>
@raderj89
raderj89 / new.html.erb
Last active December 30, 2015 07:59
my horrible awful subscription solution
<h1>Select a plan</h1>
<div class="row">
<%= form_for @subscription, url: user_subscriptions_path, method: :post, html: { class: 'form-horizontal' } do %>
<div class="col-sm-4">
<%= hidden_field_tag :stripe_card_token %>
<div class="form-group">
<%= label_tag "Premium" %>