Skip to content

Instantly share code, notes, and snippets.

View brand-it's full-sized avatar

Brandt Lareau brand-it

View GitHub Profile
@brand-it
brand-it / bank.cpp
Created June 7, 2012 15:32
Bank program not no name input
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
float balance;
void balanceStatment(){
cout << "Your current balance is: $" << balance << endl;
}
@brand-it
brand-it / lets_play_a_game.cpp
Created May 31, 2012 17:55
Average Score Calculator using prototype to define the functions
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
void main() {
int inputData(string [], int [], int);
double calculateAverage(int [], int);
void displayScoreBoard(int [], string [], int);
@brand-it
brand-it / sort_array.cpp
Created May 29, 2012 17:34
Sort array calculation
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
const int array_size = 9;
int array_of_numbers[array_size];
void exchangeSort(){
@brand-it
brand-it / phone.cpp
Created May 24, 2012 17:58
Phone number validations made in C++ not very good but it works
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
char d1, d2, d3, d4, d5, d6, d7, d8;
char digitConvertion(char d){
char value = d;
switch (toupper(d)){
@brand-it
brand-it / game.cpp
Created May 17, 2012 18:53
Lets play a game a fun game of guessing numbers
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int number;
static int lowRange = 1;
static int highRange = 100;
int numberOfTries = 10;
bool incorrect = true;
@brand-it
brand-it / drivers.cpp
Created May 17, 2012 18:38
Average system for loop and stuff
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int total_judges = 0;
double total_number = 0;
double judges[5];
string name, city;
int drivers = 0;
@brand-it
brand-it / program.cpp
Created May 17, 2012 18:37
C++ Program
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int m; //Total number of rows
int n; //Total number columns
double w; //The size of each tile in inches
double h; //The size of each tile in inches
@brand-it
brand-it / application_controller.rb
Created March 26, 2012 21:57
A nice way to send session data to the active recored.
class ApplicationController < ActionController::Base
# Your existing stuff
around_filter :you_dont_have_bloody_clue
protected
def you_dont_have_bloody_clue
klasses = [ActiveRecord::Base, ActiveRecord::Base.class]
methods = ["session", "cookies", "params", "request"]
@brand-it
brand-it / application.rb
Created October 27, 2011 21:27
Rails 3.1.0 Application file upgraded What it looks like after upgrading my r3dux.net site.
require File.expand_path('../boot', __FILE__)
require 'rails/all'
require 'lib/error_form_builder'
# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env) if defined?(Bundler)
@brand-it
brand-it / Gemfile
Created October 27, 2011 04:31
This is what My rails 3.0.9 R3dux.net site Gemfile looks like
source 'http://rubygems.org'
gem 'rails', '3.0.9'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem "authlogic", :git => 'git://github.com/odorcicd/authlogic.git', :branch => "rails3"
gem "carrierwave", :git => "git://github.com/jnicklas/carrierwave.git", :branch => "0.5-stable"