MDX is super-cool, allowing one to include React Components in a markdown file:
# Title
A nicely formatted paragraph of text with [some links](www.blahblah.com).
| // Utility types (required only once): | |
| interface Phantom<T> { | |
| __phantom: T; | |
| } | |
| // The idea is that you narrow the type you're going | |
| // to use with a property which you're definitely not | |
| // going to use, but that distinguishes this from | |
| // any old object which matches the same base interface. | |
| export type NewType<T, TagT> = T & Phantom<TagT>; |
MDX is super-cool, allowing one to include React Components in a markdown file:
# Title
A nicely formatted paragraph of text with [some links](www.blahblah.com).
| { | |
| "name": "reason-react-example", | |
| "bsc-flags": ["-bs-no-version-header", "-bs-super-errors"], | |
| "reason": {"react-jsx" : 2}, | |
| "bs-dependencies": [ | |
| "reason-react", | |
| "bs-fetch", | |
| "@glennsl/bs-json" | |
| ], | |
| "sources": [ |
| // Future versions of Hyper may add additional config options, | |
| // which will not automatically be merged into this file. | |
| // See https://hyper.is#cfg for all currently supported options. | |
| module.exports = { | |
| config: { | |
| // default font size in pixels for all tabs | |
| fontSize: 12, | |
| // font family with optional fallbacks |
| {} |
From an appropriate location:
mkdir replica-set
mkdir -p replica-set/rs0-0 replica-set/rs0-1
mongod --port 27018 --dbpath replica-set/rs0-0 --replSet rs0 --smallfiles --oplogSize 128 &
mongod --port 27019 --dbpath replica-set/rs0-1 --replSet rs0 --smallfiles --oplogSize 128 &
mongo localhost:27018| Blaze.TemplateInstance.prototype.get = function(key) { | |
| var checkForKey = function(view) { | |
| if (view && view.template instanceof Blaze.Template) { | |
| var template = view.templateInstance() | |
| if (typeof template[key] !== 'undefined') return template[key] | |
| } | |
| if (view.parentView) return checkForKey(view.parentView) | |
| } | |
| return checkForKey(this.view) | |
| } |
| var randomLetter = function() {return String.fromCharCode(Math.floor(Math.random()*26) + 65);} | |
| var randomNumber = function() {return String.fromCharCode(Math.floor(Math.random()*10) + 48);}; | |
| var genDict = { | |
| 'l': randomLetter, | |
| 'n': randomNumber | |
| }; | |
| // pass in a format string of the type: "4l 3n 2l", i.e. a space-delimited set of number/letter | |
| // pairs, the first of which gives the number of characters of the given type and the second | |
| // denotes the type: "n" for number, "l" for letter (always upper-case). |
| function generateNINO(style) { | |
| var group1 = ''; | |
| var group2 = ''; | |
| var group3 = ''; | |
| var group4 = ''; | |
| var group5 = ''; | |
| var randomArrayIndex = ''; | |
| var notAllowed = new Array('GB', 'BG', 'NK', 'KN', 'TN', 'NT', 'ZZ'); | |
| var firstAllowed = new Array('A', 'B', 'C', 'E', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'W', 'X', 'Y', 'Z'); | |
| var secondAllowed = new Array('A', 'B', 'C', 'E', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'R', 'S', 'T', 'W', 'X', 'Y', 'Z'); |
| var calledFromServer; | |
| Meteor.methods({ | |
| 'getThis': function() { | |
| return this; | |
| }, | |
| 'getThisServer': function() { | |
| return calledFromServer; | |
| } |