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
| $.fn.extend({ | |
| setClass: function(name, add) { | |
| if(typeof name === 'object') { | |
| const classes = name; | |
| Object.keys(classes).forEach(className => { | |
| this.setClass(className, classes[className]); | |
| }); | |
| } else { | |
| this.each((index, elem) => { | |
| if(add) { |
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() { | |
| var days = [ | |
| "Sunday", | |
| "Monday", | |
| "Tuesday", | |
| "Wednesday", | |
| "Thursday", | |
| "Friday", | |
| "Saturday" |
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
| /* | |
| Example: Extended EMF Actor Class | |
| This is not in the core package because | |
| (1) it is trivial to implement and everyone should | |
| be using their own base classes, and | |
| (2) it sets a couple bad presidences mainly that | |
| (a) methods and actions are 1:1 and | |
| (b) calls to Actor should only have one arg, and | |
| (3) makes debugging and type-checking tough as functions | |
| are created at runtime. |
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
| /* | |
| This gist aims to demonstrate how sets can | |
| be compared in Seth. | |
| All set-to-set comparison methods begin with | |
| `is` such as `#isSuperset()`. And these methods | |
| return a Proof class instance with useful | |
| assertion methods. | |
| Comparisons must be proved through assertions |
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
| # socket.coffee | |
| module.exports = (soc) -> | |
| debug = true | |
| # router | |
| soc.routes = [] | |
| soc.mount = (action, next = ->) -> | |
| soc.routes.push [action, next] |
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
| // controllerSample.js | |
| module.exports = function($) { | |
| return require('../slave.js')($, function($) { | |
| /* If you need to add mixins or properties to the objects | |
| that are given from master.js, you need to declare those | |
| inside of this function. Otherwise, they will not work. */ | |
| _.mixin({ | |
| compactObject: function(to_clean) { | |
| $._.map(to_clean, function(value, key, to_clean) { |
NewerOlder