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
| // in next.config.js | |
| import packageJson from "./package.json" | |
| module.exports = { | |
| env: { | |
| NEXT_PUBLIC_APP_VERSION: packageJson.version | |
| } | |
| } |
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
| import snakeCase from 'lodash/snakeCase'; | |
| import { Meteor } from 'meteor/meteor'; | |
| import { Random } from 'meteor/random'; | |
| import fs from 'fs'; | |
| let bound; | |
| if (Meteor.isServer) { | |
| bound = Meteor.bindEnvironment(callback => callback()); | |
| } |
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
| // Package 1 - "my-basic-ui" | |
| const MyBasicButton = ({onClick, children}) => ( | |
| <button onClick={onClick}> | |
| {children} | |
| </button> | |
| ) | |
| // Tell other packages they can use your component | |
| // under the name "Button" | |
| registerComponent({ | |
| name: 'Button', |
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
| VendingMachines.addField([ | |
| { | |
| fieldName: 'lastRefillAt', | |
| fieldSchema: { | |
| type: Date, | |
| optional: true, | |
| viewableBy:['runners', 'managers', 'admins'], | |
| resolveAs: { | |
| type: 'Date', | |
| resolver(vendingMachine, args, context) { |
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 MyService { | |
| constructor(options) { | |
| // options must contain the knexClient | |
| // (simply pass it when initializing the service) | |
| this.options = options || {}; | |
| } | |
| async find(params){ | |
| const { db } = this.options | |
| const q = db.raw(`SELECT * FROM TABLE`) |
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
| // my-service.hooks.js | |
| module.exports = { | |
| before:{ | |
| find:[ | |
| async findQuery(context){ | |
| // get the client (Express global) | |
| const { db } = context.app.get('knexClient') | |
| // build and run the query | |
| const q = db.raw(`SELECT * FROM TABLE`) | |
| const res = await q |
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
| <ObjectElement keyPath="user" onChange={doChange}> | |
| <div> | |
| <StringInput keyPath="name"/> | |
| </div> | |
| </ObjectElement> |
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
| <ArrayElement keyPath="subsets" onChange={updateReduxState}> | |
| <ObjectElement wrapper> | |
| <StringInput keyPath="name"/> | |
| <QueryInput keyPath="column" options={availableColumns}/> | |
| <StringInput keyPath="value" /> | |
| <ColorInput keyPath="color" /> | |
| </ObjectElement> | |
| <ArrayElement/> |
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
| const lodashId = require('lodash-id') | |
| const FileSync = require('lowdb/adapters/FileSync') | |
| | |
| const adapter = new FileSync('db.json') | |
| const db = low(adapter) | |
| | |
| db._.mixin(lodashId) | |
| | |
| // We need to set some default values, if the collection does not exist yet | |
| // We also can store our collection |
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
| rpcServer.invoke('fastFilter', 'my-filter-id', { "range": [10,20] }, (err, done) => { | |
| // handle response or error | |
| }); |