Skip to content

Instantly share code, notes, and snippets.

const createEntityValidationHooks = require('./create-entity-validation-hooks');
/**
* Create a service backed by the entity service.
* @param {object} app - Feathers app instance
* @param {string} options.entityType - Name of the entity type
* @param {string} options.serviceName - Name of the service
<template>
<div>
<span>Connected:{{ feathers.connected }}</span
><br />
<span>Online:{{ feathers.online }}</span>
</div>
</template>
<script>
export default {
name:'ConnectionStatus',
int buttonNum = getarg(0); // First param is my buttonID#.
string buttonId = format("%d", buttonNum); // Convert the number to a string
int buttonCode = ActionPadGetItemMemberCode(buttonId); // Get the button's member id Code
switch(buttonNum){
case 21: int nPreset = 2;
CuelistStart(QL(nPreset)); // Start the specified cuelist
VersatileMasterStartAutoFade(nPreset, 100, 3000);// Fade the requested cuelist up
ActionPadSetItemActiveState(buttonCode, 1); // Set that button to be active.
break;
@RubyRubenstahl
RubyRubenstahl / badLorem.js
Created January 1, 2019 18:36
A bad example of a lorem generator, just for fun
function Lorem(C){
var lorem = "";
for(var N=1; N < C; N = N + 1){
var RN = Math.floor(Math.random()*129);
switch(RN){
case 0:
lorem = lorem + "\n\n"
case 1:
lorem = lorem + "Sed" + " "
break
const foreignKeyJoin = (
idKey,
populatedKey,
serviceName,
) => args => async (item, context) => {
const res = await context.app.services[serviceName].find({
query: {
_id: { $in: item[idKey] }
}
@RubyRubenstahl
RubyRubenstahl / feathersApp.js
Created April 30, 2018 15:46
Feathers app issue sample code
import feathers from '@feathersjs/feathers';
import socketio from '@feathersjs/socketio-client';
import io from 'socket.io-client';
const socket = io('http://127.0.0.1:3030');
const app = feathers();
export default app;
// Set up Socket.io client with the socket
app.configure(socketio(socket));
@RubyRubenstahl
RubyRubenstahl / media.model.js
Created February 21, 2018 02:49
Mongoose discriminators in feathers-cli generated service.
// media-model.js - A mongoose model
//
// See http://mongoosejs.com/docs/models.html
// for more of what you can do here.
module.exports = function (app) {
const mongooseClient = app.get('mongooseClient');
const { Schema } = mongooseClient;
const options = {
discriminatorKey: 'type',
function DeviceManager(driverFactory) {
var devices = {};
function addDevice(name, driver, config){
if(devices[name] !== undefined){
return Promise.reject(new Error(`Device with name of ${ name } already exists`));
}
driverFactory.create(driver, config, {})
.then(
/**
* Created by Mike on 2/22/2017.
*/
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { feathersServices } from '../../../feathers';
import TranscriptEditor from './TranscriptEditor'
/**
* Created by Mike on 2/21/2017.
*/
import React, { PropTypes } from 'react';
import { Link } from 'react-router'
import {Card, CardActions, CardHeader, CardMedia, CardTitle, CardText} from 'material-ui/Card';
import FlatButton from 'material-ui/FlatButton';
//TODO: grab avatar image dynamcially
//TODO: wire up edit button