Skip to content

Instantly share code, notes, and snippets.

@jameskerr
jameskerr / gist:69cedb2f30c95342f64a
Created May 13, 2015 16:48
Preview an update to a Rails Model without saving anything to the database.
# This class calls collection.build on each association that you specify in the @@variables,
# then calls assign_attributes on the attributes specific to this model.
#
# This class was created after I asked this question on stackoverflow.
# http://stackoverflow.com/questions/30109549/rails-preview-update-associations-without-saving-to-database
class PreviewEventUpdate
attr_accessor :params, :nested_params, :event
@@ids_keys = [:audience_ids, :group_ids, :location_ids, :user_ids].freeze
#ifndef MAC //if not MAC
#include <GL\glut.h>
#else // MAC includes below
#include <GLUT/glut.h>
#endif
/**********************
::: UTILITY CLASSES :::
***********************/
#include <stdlib.h>
#include <GLUT/glut.h>
#include <math.h>
/*************************
::: HELPER VARIABLES ::: *
*************************/
enum FONT_TYPE {
@jameskerr
jameskerr / gist:719e56414a4fe43b7c48
Created January 7, 2015 06:41
Assignment 2 (Primitive Practice)
#include <stdlib.h>
#include <GLUT/glut.h>
#include <math.h>
/*************************
::: HELPER VARIABLES ::: *
*************************/
enum MENU_TYPE {

Chapman University Web

www

Primary Language: Velocity
Frameworks: Cascade CMS
Hosted By: IS&T

Blogs