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
| class Enum | |
| constructor: (fields) -> | |
| if !fields?.length or !Array.isArray fields then throw 'Fields must be an array of Strings' | |
| fields.forEach (field) => @[field.toUpperCase()] = field.toUpperCase() | |
| myEnum = new Enum(['ONE', 'TWO']) | |
| console.log 'Enum', myEnum |
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 Enum; | |
| module.exports = Enum = (function() { | |
| function Enum(fields) { | |
| var _this = this; | |
| if (!(fields != null ? fields.length : void 0) || !Array.isArray(fields)) { | |
| throw 'Fields must be an array of Strings'; | |
| } | |
| fields.forEach(function(field) { | |
| return _this[field.toUpperCase()] = field.toUpperCase(); |
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
| # str: The string we wish to split up | |
| # length: how many characters of 'str' should each array element contain | |
| # padWith: what to padd the last element with | |
| splitBy = (str, length, padWith) -> | |
| pad = (str) -> | |
| str = "#{str}#{padWith}" for i in [str.length...length] | |
| str | |
| pad (str.slice i, i+length), length, padWith for i in [0...str.length] by length | |
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 WATCHER = function(oldValues, newValues, map) { | |
| var changes, index, value; | |
| changes = {}; | |
| if (Array.isArray(oldValues)) { | |
| for (index in oldValues) { | |
| value = oldValues[index]; | |
| if (value !== newValues[index]) { | |
| changes[map[index]] = { | |
| oldVal: oldValues[index] | |
| newVal: newValues[index] |
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
| { | |
| "caret_style": "phase", | |
| "close_windows_when_empty": false, | |
| "color_scheme": "Packages/Theme - Flatland/Flatland Dark.tmTheme", | |
| "ensure_newline_at_eof_on_save": true, | |
| "flatland_sidebar_tree_xsmall": true, | |
| "flatland_square_tabs": true, | |
| "font_size": 15.0, | |
| "highlight_line": true, | |
| "highlight_modified_tabs": true, |
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
Show hidden characters
| { | |
| "high_visibility_enabled_by_default": true, | |
| "high_visibility_style": "underline", | |
| "high_visibility_color": "__bracket__" | |
| } |
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
| // colour vars (or color if you're American) | |
| @plain-black: #000; | |
| @plain-white: #fff; | |
| @funky-green: #00ff00; // original | |
| .title-bar { | |
| padding: 15px; | |
| letter-spacing: 0.08em; | |
| font-size: 1.1em; | |
| } |
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
| { | |
| "max_line_length": { | |
| "name": "max_line_length", | |
| "value": 120, | |
| "level": "error", | |
| "limitComments": true | |
| } | |
| } |
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 https = require('https'); | |
| var fs = require('fs'); | |
| var sslOptions = { | |
| key: fs.readFileSync('localhost.key'), | |
| cert: fs.readFileSync('localhost.crt') | |
| }; | |
| process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; |
OlderNewer