View this code at http://livecoding.io/5923109
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <GLUT/glut.h> | |
#include <math.h> | |
/************************* | |
::: HELPER VARIABLES ::: * | |
*************************/ | |
enum MENU_TYPE { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <GLUT/glut.h> | |
#include <math.h> | |
/************************* | |
::: HELPER VARIABLES ::: * | |
*************************/ | |
enum FONT_TYPE { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef MAC //if not MAC | |
#include <GL\glut.h> | |
#else // MAC includes below | |
#include <GLUT/glut.h> | |
#endif | |
/********************** | |
::: UTILITY CLASSES ::: | |
***********************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See if an object is "complete" and give it a score. Example useage | |
# would look like this. | |
CompletenessAnalyzer.new(object: Event.find(1), criteria: [ | |
Criterion.new({ | |
name: 'Audience', | |
message: 'Whom is your event is intended for?', | |
condition: ->(event) { event.audiences.empty? } | |
}), | |
Criterion.new({ | |
name: 'Contact Info', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* FORM FIELD CONFIGURATION | |
* | |
* In the configure-cycle.js view, we will determine what type of | |
* cycle we are dealing with, and choose the correct configuration | |
* object. The keys of these configuration objects represent the file | |
* name where the subview lives. The value represents the options | |
* object that will be passed to the view's initialize() method. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to solve this "special" goals question. | |
Since we are saving the questions through the cycle model via the | |
`accepts_nested_attributes`, feature in Rails, we don't need to make | |
more than one ajax call when saving the questions. When we save all | |
the questions data, we will also use this "special" goals question (GQ) | |
to add the following fields to the save data. | |
* cycle.goals_question_type | |
* cycle.goals_question_multchoice_desc |
OlderNewer