#A hash of arrays:
widget[]=first-widget&gadget[]=a-gadget&widget[]=another%20widget
Resulting Params:
{
:widget => [ "first-widget", "another widget"],
:gadget => [ "a-gadget" ]
}
| /* | |
| * update the events rendering in the calendar. Add if does not yet exist. | |
| */ | |
| _updateEventInCalendar : function (calEvent) { | |
| var self = this; | |
| self._cleanEvent(calEvent); | |
| if (calEvent.id) { | |
| self.element.find(".wc-cal-event").each(function() { |
| # Is there a coffeescript way of doing this? | |
| (function($, exports){ | |
| # doing random stuff here | |
| })(jQuery, window); | |
| # Other than this: | |
| ( ($, exports) -> | |
| # doing random stuff here |
#A hash of arrays:
widget[]=first-widget&gadget[]=a-gadget&widget[]=another%20widget
Resulting Params:
{
:widget => [ "first-widget", "another widget"],
:gadget => [ "a-gadget" ]
}
| #As coded this is suiteable for adding to ApplicationController, or an included controller module | |
| #It would also be cool to refactor this code to be added to fat models instead | |
| def object_graph | |
| @prune_nodes = params[:prune_nodes] #When the crawler hits a node of this class, it will stop | |
| model_name = controller_name.classify | |
| root_object = model_name.classify.constantize.find(params[:id]) | |
| edge_list = {} #This is implemented as an object instead of an array for lookup performance reasons | |
| nodes = {} | |
| object_ident = ->(object){"#{object.id}-#{object.class}"} #helper function | |
| fill_object_data = ->(object, ident) do #add some data to the JSON object that will be used by the renderer |
| class AssociativeObject | |
| def eigenclass; class << self; self; end; end | |
| #form_for requires these methods | |
| attr_accessor :id | |
| attr_accessor :errors | |
| def new_record?; return true; end | |
| def to_param; return nil; end #for AR object to_param returns nil for new objects | |
| def to_key; id ? [id] : nil end #borrowed from rails source for dummy object | |
| def self.model_name; ActiveModel::Name.new(self); end #how AR determines the name for the params hash. TODO: allow dynamic assignment |
| app.get "/ls", (req, res)-> | |
| path = "." | |
| directoryCount = 0 | |
| edges = {} #key only for internal purpose {key:[], key2:[]} | |
| nodes = {} #stores data for nodes | |
| recursiveCalls = 0 | |
| nodeId = (path)-> | |
| "#{path}" | |
| recursionComplete = ()-> | |
| console.log "-- Directory Count: ", directoryCount |
| // If you pash an object of the same format as `testCases` it will be merged into test cases | |
| // requires jQuery | |
| var objectSupport = function(additionalObjects){ | |
| additionalObjects = typeof additionalObjects !== 'undefined' ? additionalObjects : {}; | |
| if(!jQuery){throw new Error("clientJSError requires jQuery");} | |
| //takes an object path, returns true of it's available. For Example: | |
| // >objectSupported("Array.prototype.forEach") | |
| // >false //false in IE7 | |
| // |
| syntax on | |
| set tabstop=2 | |
| set softtabstop=2 | |
| set shiftwidth=2 | |
| set expandtab | |
| set indentexpr= | |
| set number | |
| set ai | |
| "for snippets plugin |
On landing page both the email and text should do the same action.
Contest page, maybe replace landing page.
Focus webpage on contest
Try to implement a story upload on the contest site.
Send a story based on some ones' mood "I'm pissed"
Themed contest by season, so content is pre-sorted.
| jQuery ($)-> | |
| $.widget 'yourNamespace.yourPluginName', | |
| options: | |
| _create: -> | |
| $ele = $(@element) |