This file contains hidden or 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
| def all | |
| if current_user.has_projects? | |
| @trial = current_user.trials.first | |
| @project = @trial.project | |
| else | |
| @trial = Trial.new | |
| @project = current_user.projects.first | |
| end | |
| @is_new = params[:new] |
This file contains hidden or 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
| var Hyphenator = new Class ({ | |
| Implements: [Events, Options], | |
| options: { | |
| separator: '-', | |
| trigger: 'keyup', | |
| prepend: '', | |
| allowed: /[^\w\d\s-]/g | |
| }, |
This file contains hidden or 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
| //Create URL slug | |
| var urlText = new Element('a', { | |
| 'href':'#', | |
| 'id':'fullUrlToggle', | |
| 'html':$('viewFullUrl').get('value') | |
| }); | |
| $('urlLabel').appendText(' ').grab(urlText); | |
| $('fullUrlToggle').addEvent('click', function(e){ | |
| e.stop(); |
This file contains hidden or 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
| def format_data | |
| tasks = self.task_completions.select( | |
| "task_completions.skipped, | |
| task_completions.created_at, | |
| task_completions.timestamp, | |
| demographics.gender, | |
| demographics.age, | |
| demographics.location, | |
| demographics.ethnicity, | |
| demographics.income, |
This file contains hidden or 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
| (function($) { | |
| $.widget("ui.demographics_filter", { | |
| _initialize: function(){ | |
| this.getFilters(); | |
| this._wire(); | |
| }, | |
| _wire: function(){ | |
| var self = this; | |
| $('.btn-group').click(function(){ |
This file contains hidden or 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
| <?php | |
| /** | |
| * @author Benjamin Kuker | |
| * @description A simple user class. Normally, this would interact with a database and form validation code, but for | |
| * demonstration purposes, I'm simply throwing exceptions when errors occur. | |
| * | |
| * Also, please note: I rarely, if ever, use static methods or classes because they aren't easily testable or | |
| * extensible and I almost always want to work with an object. If I were to need a static method, I would implement a | |
| * function instead. See http://stackoverflow.com/questions/1185605/ for more. Because I probably wouldn't use it in | |
| * real life, and in order to give you a more accurate picture of how I code, I've ommitted the static method. |
This file contains hidden or 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
| .floatingSquare { | |
| background: #FFF; | |
| display: block; | |
| height: 100px; | |
| left: 45%; | |
| opacity: 0.5; | |
| position: absolute; | |
| top: 45%; | |
| width: 100px; | |
| } |
This file contains hidden or 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
| <?php | |
| /** | |
| * @description An abstract class for all chess pieces | |
| * @author Benjamin Kuker | |
| */ | |
| abstract class ChessPiece { | |
| protected $color = null; | |
| protected $constraints = array(); | |
| protected $currentPosition = null; |
This file contains hidden or 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
| /** | |
| * Utility class for dealing with SVG elements | |
| * Copyright Virtuosi Media, Inc. 2012 | |
| * MIT License | |
| */ | |
| var SVG = new Class({ | |
| /** | |
| * @param string - el - The type of SVG element | |
| * @param object - options - The attributes and values for the SVG element, stored in a hash |
This file contains hidden or 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
| <!doctype html> | |
| <html> | |
| <head> | |
| </head> | |
| <body> | |
| <script type="text/javascript"> | |
| var app = function(){ | |
| console.log('Initialize App'); | |
| var test = new Test(); | |
| var foo = new Foo(); |