Skip to content

Instantly share code, notes, and snippets.

View CameronCarroll's full-sized avatar

Cameron Carroll CameronCarroll

View GitHub Profile
@CameronCarroll
CameronCarroll / Import
Created July 22, 2011 02:52 — forked from BDQ/Import
namespace :spree do
desc "Export Products to CSV File"
task :export_products => :environment do
require 'fastercsv'
products = Product.find(:all)
puts "Exporting to #{RAILS_ROOT}/products.csv"
FasterCSV.open("#{RAILS_ROOT}/products.csv", "w") do |csv|
csv << ["id", "name", "description","sku", "master_price" ]
Started GET "/assets/admin/all.js" for 127.0.0.1 at 2011-10-10 21:12:53 -0700
Compiled admin/all.js (27ms) (pid 9577)
Compiled admin/spree_core.js (82ms) (pid 9577)
Compiled jquery.js (5ms) (pid 9577)
Compiled jquery_ujs.js (1ms) (pid 9577)
Compiled jquery-ui.js (4ms) (pid 9577)
Compiled jquery.cookie.js (0ms) (pid 9577)
Compiled jquery.tokeninput.js (0ms) (pid 9577)
Compiled jquery.delayedobserver.js (0ms) (pid 9577)
Compiled jquery.jstree/jquery.jstree.js (3ms) (pid 9577)
@CameronCarroll
CameronCarroll / fr_setup.txt
Created November 23, 2011 07:08
How to setup RVM & Rails on a new Fedora machine
openssl & openssl-devel
curses
fiddle
gdbm
dl/win32
readline
INSTALLED
@CameronCarroll
CameronCarroll / snippets
Created December 17, 2011 04:42
Snippets, yo
gem install ruby-debug-base19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-head
gem install linecache19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-head
@CameronCarroll
CameronCarroll / guesser.m
Created February 10, 2012 08:53
number guessing game program thingy
% Script file: guesser.m
%
% Programmer: Cameron Carroll
clc;
clear;
low = 1;
high = 100;
successful = false;
clear;
clc;
clf;
t=0:0.05:10;
z = (exp(-0.8.*t).*(0.33*cos(8.*t)-0.22*sin(8.*t)));
plot(t,z);
grid on;
xlabel('Time/sec');
% Script File: loopvsvector.m
%
% Programmer: Cameron Carroll
%
% February 21-22, 2012
%
% Purpose:
% ---------
% Solve and plot f(x) = x^2 - 3x + 2. Intended to show the
% differences between a vectorized approach to problem solving versus
@CameronCarroll
CameronCarroll / constructor.java
Created April 23, 2012 17:03
constructor (java)
/* Java: Constructor example */
/* example code from http://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html */
/* constructor method */
public Bicycle(int startCadence, int startSpeed, int startGear) {
gear = startGear;
cadence = startCadence;
speed = startSpeed;
}
@CameronCarroll
CameronCarroll / constructor.cpp
Created April 23, 2012 17:11
constructor (cpp)
/* Constructor Example (CPP) */
/* Example code from http://www.horstmann.com/ccj2/ccjapp3.html */
/* Declare a class with a default constructor, and a constructor accepting two double variables. */
class Point
{
public:
Point();
Point(double xval, double yval);
@CameronCarroll
CameronCarroll / oilsim_project.m
Created May 12, 2012 22:35
engr 120 final: exxon-valdez oil spill simulation
% Script File: oilsim_project.m
%
% Exxon-Valdez Spill Simulation: Engr 120 Final Project
% Copyright (C) 2012 Cameron Carroll
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%